[FFmpeg-cvslog] vf_scale_vaapi: Respect driver quirks around buffer destruction

Mark Thompson git at videolan.org
Sun Nov 13 22:59:41 EET 2016


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Jun 26 22:35:49 2016 +0100| [1a359e53418ff15b1c9b1e03c05b160f01e1ce0f] | committer: Mark Thompson

vf_scale_vaapi: Respect driver quirks around buffer destruction

(cherry picked from commit 582d4211e00015b68626f77ce4af53161e2b1713)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a359e53418ff15b1c9b1e03c05b160f01e1ce0f
---

 libavfilter/vf_scale_vaapi.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 8dd5acf..d1cb246 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -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);



More information about the ffmpeg-cvslog mailing list