]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_blackframe.c
lavfi: create buffer reference in filters which need to access the ref later
[ffmpeg] / libavfilter / vf_blackframe.c
index d57092ddf2e5b33f3fbb8a4a635d78dee4891f2f..7e80fd7e466f4b29c41a5bef308786a71b34ded8 100644 (file)
@@ -28,6 +28,7 @@
  */
 
 #include "avfilter.h"
+#include "internal.h"
 
 typedef struct {
     unsigned int bamount; ///< black amount
@@ -110,6 +111,7 @@ static void end_frame(AVFilterLink *inlink)
 
     blackframe->frame++;
     blackframe->nblack = 0;
+    avfilter_unref_buffer(picref);
     avfilter_end_frame(inlink->dst->outputs[0]);
 }
 
@@ -126,7 +128,7 @@ AVFilter avfilter_vf_blackframe = {
                                     .type             = AVMEDIA_TYPE_VIDEO,
                                     .draw_slice       = draw_slice,
                                     .get_video_buffer = avfilter_null_get_video_buffer,
-                                    .start_frame      = avfilter_null_start_frame,
+                                    .start_frame      = ff_null_start_frame_keep_ref,
                                     .end_frame        = end_frame, },
                                   { .name = NULL}},