]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_bbox.c
lavfi/hflip: copy palette data in start_frame()
[ffmpeg] / libavfilter / vf_bbox.c
index 98ae92cabfc5ca090d0695f11416a442ed1a082e..f8dc625524b2f0b7af7320a93d227c8a0d07b5cb 100644 (file)
@@ -27,6 +27,7 @@
 #include "libavutil/timestamp.h"
 #include "avfilter.h"
 #include "bbox.h"
+#include "internal.h"
 
 typedef struct {
     unsigned int frame;
@@ -76,7 +77,7 @@ static void end_frame(AVFilterLink *inlink)
 
     if (has_bbox) {
         av_log(ctx, AV_LOG_INFO,
-               "x1:%d x2:%d y1:%d y2:%d w:%d h:%d"
+               " x1:%d x2:%d y1:%d y2:%d w:%d h:%d"
                " crop=%d:%d:%d:%d drawbox=%d:%d:%d:%d",
                box.x1, box.x2, box.y1, box.y2, w, h,
                w, h, box.x1, box.y1,    /* crop params */
@@ -85,6 +86,7 @@ static void end_frame(AVFilterLink *inlink)
     av_log(ctx, AV_LOG_INFO, "\n");
 
     bbox->frame++;
+    avfilter_unref_buffer(picref);
     avfilter_end_frame(inlink->dst->outputs[0]);
 }
 
@@ -99,7 +101,7 @@ AVFilter avfilter_vf_bbox = {
         { .name             = "default",
           .type             = AVMEDIA_TYPE_VIDEO,
           .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,
           .min_perms        = AV_PERM_READ, },
         { .name = NULL }