[FFmpeg-devel] [PATCH 2/4] lavfi/deinterlace_vaapi: fix typo and add check.

Jun Zhao mypopydev at gmail.com
Tue Jan 23 06:33:26 EET 2018


-------------- next part --------------
From 92294e97ffee609a2cac298f3ff0b51f3e3e37ef Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao at intel.com>
Date: Tue, 23 Jan 2018 11:24:53 +0800
Subject: [PATCH 2/4] lavfi/deinterlace_vaapi: fix typo and add check.

Signed-off-by: Jun Zhao <jun.zhao at intel.com>
---
 libavfilter/vf_deinterlace_vaapi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
index 9700f85817..97b1d77840 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -33,7 +33,7 @@
 #define MAX_REFERENCES 8
 
 typedef struct DeintVAAPIContext {
-    VAAPIVPPContext vpp_ctx; // must be the first fileld
+    VAAPIVPPContext vpp_ctx; // must be the first field
 
     int                mode;
     int                field_rate;
@@ -285,8 +285,10 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
                 av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter "
                        "buffer: %d (%s).\n", vas, vaErrorStr(vas));
 
-            params.filters     = &vpp_ctx->filter_buffers[0];
-            params.num_filters = 1;
+            if (vpp_ctx->nb_filter_buffers) {
+                params.filters     = &vpp_ctx->filter_buffers[0];
+                params.num_filters = vpp_ctx->nb_filter_buffers;
+            }
 
             params.forward_references = forward_references;
             params.num_forward_references =
-- 
2.14.1



More information about the ffmpeg-devel mailing list