[FFmpeg-cvslog] lavfi/thumbnail: use avfilter_unref_bufferp() where appropriate.

Clément Bœsch git at videolan.org
Thu Nov 29 01:45:09 CET 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Nov 29 01:38:08 2012 +0100| [782993d9e42462d99fd839bdc0967e006bc0781e] | committer: Clément Bœsch

lavfi/thumbnail: use avfilter_unref_bufferp() where appropriate.

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

 libavfilter/vf_thumbnail.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c
index beec31c..afaa3b7 100644
--- a/libavfilter/vf_thumbnail.c
+++ b/libavfilter/vf_thumbnail.c
@@ -135,8 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *frame)
         memset(thumb->frames[i].histogram, 0, sizeof(thumb->frames[i].histogram));
         if (i == best_frame_idx)
             continue;
-        avfilter_unref_buffer(thumb->frames[i].buf);
-        thumb->frames[i].buf = NULL;
+        avfilter_unref_bufferp(&thumb->frames[i].buf);
     }
     thumb->n = 0;
 
@@ -152,10 +151,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
     int i;
     ThumbContext *thumb = ctx->priv;
-    for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++) {
-        avfilter_unref_buffer(thumb->frames[i].buf);
-        thumb->frames[i].buf = NULL;
-    }
+    for (i = 0; i < thumb->n_frames && thumb->frames[i].buf; i++)
+        avfilter_unref_bufferp(&thumb->frames[i].buf);
     av_freep(&thumb->frames);
 }
 



More information about the ffmpeg-cvslog mailing list