diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-21 22:19:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-21 22:20:49 +0200 |
commit | 9e1508f1e7a21aab9c25614c03d726e400c5691c (patch) | |
tree | 1450ec6130c71c5d1867b43c5333b0afc2e62212 /libavfilter/video.c | |
parent | f7e0c1854950b072dce4aa21053c1a344bf76c72 (diff) | |
parent | 4c9080a7ef18ad71fb0a75c8d1c1803edd780edd (diff) | |
download | ffmpeg-9e1508f1e7a21aab9c25614c03d726e400c5691c.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
lavfi: unref AVFilterLink.out_buf in ff_end_frame().
lavfi: unref AVFilterLink.cur_buf in ff_end_frame().
vsrc_testsrc: avoid an unnecessary avfilter_ref_buffer().
vf_slicify: clear AVFilterLink.cur_buf in start_frame().
vf_settb: simplify start_frame().
vf_fieldorder: don't give up its own reference to the output buffer.
vf_pad: don't give up its own reference to the output buffer.
vf_overlay: don't access a buffer reference that's been given away.
vf_drawtext: don't give up its own reference to the input buffer.
vf_gradfun: don't store two pointers to one AVFilterBufferRef.
vf_delogo: don't store two pointers to one AVFilterBufferRef.
vf_aspect: clear AVFilterLink.cur_buf in start_frame().
lavfi: add avfilter_unref_bufferp()
Conflicts:
doc/APIchanges
libavfilter/avfilter.h
libavfilter/buffer.c
libavfilter/vf_aspect.c
libavfilter/vf_drawtext.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/video.c')
-rw-r--r-- | libavfilter/video.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libavfilter/video.c b/libavfilter/video.c index 4e3de8d4b0..0eed22129a 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -151,7 +151,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) @@ -178,6 +179,7 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) AVFilterPad *dst = link->dstpad; int perms = picref->perms; AVFilterCommand *cmd= link->dst->command_queue; + int64_t pts; FF_TPRINTF_START(NULL, start_frame); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " "); ff_tlog_ref(NULL, picref, 1); @@ -212,9 +214,9 @@ void ff_start_frame(AVFilterLink *link, AVFilterBufferRef *picref) ff_command_queue_pop(link->dst); cmd= link->dst->command_queue; } - + pts = link->cur_buf->pts; start_frame(link, link->cur_buf); - ff_update_link_current_pts(link, link->cur_buf->pts); + ff_update_link_current_pts(link,link->cur_buf ? link->cur_buf->pts : pts); } void ff_null_start_frame_keep_ref(AVFilterLink *inlink, @@ -235,14 +237,7 @@ 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); - outlink->out_buf = NULL; - } ff_end_frame(outlink); } } @@ -262,6 +257,10 @@ void ff_end_frame(AVFilterLink *link) avfilter_unref_buffer(link->src_buf); link->src_buf = NULL; } + if(link->cur_buf != link->out_buf) + avfilter_unref_bufferp(&link->cur_buf); + link->cur_buf = NULL; + avfilter_unref_bufferp(&link->out_buf); } void ff_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) |