]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_scale_vaapi.c
avcodec/screenpresso: return the packet size instead of 0
[ffmpeg] / libavfilter / vf_scale_vaapi.c
index 8dd5acfadab12b04dc7a422f28506ceb0918642e..d1cb246d1fd8795a37d77555e20733f2eab0e7d6 100644 (file)
@@ -342,13 +342,14 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
         goto fail_after_render;
     }
 
-    // This doesn't get freed automatically for some reason.
-    vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
-    if (vas != VA_STATUS_SUCCESS) {
-        av_log(ctx, AV_LOG_ERROR, "Failed to free parameter buffer: "
-               "%d (%s).\n", vas, vaErrorStr(vas));
-        err = AVERROR(EIO);
-        goto fail;
+    if (ctx->hwctx->driver_quirks &
+        AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
+        vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
+        if (vas != VA_STATUS_SUCCESS) {
+            av_log(ctx, AV_LOG_ERROR, "Failed to free parameter buffer: "
+                   "%d (%s).\n", vas, vaErrorStr(vas));
+            // And ignore.
+        }
     }
 
     av_frame_copy_props(output_frame, input_frame);