diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-14 17:09:43 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-20 21:10:42 +0200 |
commit | 07bad27810cdd7d3171cbd542119aa051646377c (patch) | |
tree | 3bb780df53f6779185ea0fc78ba584a7296105b8 /libavfilter/video.c | |
parent | 533fd5b5b468131cfe164455783c351eb69af657 (diff) | |
download | ffmpeg-07bad27810cdd7d3171cbd542119aa051646377c.tar.gz |
lavfi: unref AVFilterLink.cur_buf in ff_end_frame().
This reduces code duplication and prevents stale pointers from remaining
on the link.
Diffstat (limited to 'libavfilter/video.c')
-rw-r--r-- | libavfilter/video.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavfilter/video.c b/libavfilter/video.c index feaaebab86..e507f973b4 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -162,7 +162,8 @@ AVFilterBufferRef *ff_get_video_buffer(AVFilterLink *link, int perms, int w, int void ff_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) { - ff_start_frame(link->dst->outputs[0], picref); + AVFilterBufferRef *buf_out = avfilter_ref_buffer(picref, ~0); + ff_start_frame(link->dst->outputs[0], buf_out); } static void default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) @@ -223,9 +224,6 @@ static void default_end_frame(AVFilterLink *inlink) if (inlink->dst->nb_outputs) outlink = inlink->dst->outputs[0]; - avfilter_unref_buffer(inlink->cur_buf); - inlink->cur_buf = NULL; - if (outlink) { if (outlink->out_buf) { avfilter_unref_buffer(outlink->out_buf); @@ -250,6 +248,7 @@ void ff_end_frame(AVFilterLink *link) avfilter_unref_buffer(link->src_buf); link->src_buf = NULL; } + avfilter_unref_bufferp(&link->cur_buf); } void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) |