diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-15 10:28:17 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 09:14:05 +0200 |
commit | 785fa50f0b33bdbafebce49fec4df62f0c81eed4 (patch) | |
tree | 483f5a74ce50fc553bbbfe6a5b2c17abef5c74de /libavfilter/buffersrc.c | |
parent | 02ac7311c8f1f252398b57b54992756c95f77962 (diff) | |
download | ffmpeg-streaming-785fa50f0b33bdbafebce49fec4df62f0c81eed4.zip ffmpeg-streaming-785fa50f0b33bdbafebce49fec4df62f0c81eed4.tar.gz |
buffersrc: avoid creating unnecessary buffer reference
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r-- | libavfilter/buffersrc.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 2aa7d7d..16a38a6 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -323,21 +323,19 @@ static int request_frame(AVFilterLink *link) switch (link->type) { case AVMEDIA_TYPE_VIDEO: - if ((ret = ff_start_frame(link, avfilter_ref_buffer(buf, ~0))) < 0 || + if ((ret = ff_start_frame(link, buf)) < 0 || (ret = ff_draw_slice(link, 0, link->h, 1)) < 0 || (ret = ff_end_frame(link)) < 0) - goto fail; + return ret; break; case AVMEDIA_TYPE_AUDIO: - ret = ff_filter_samples(link, avfilter_ref_buffer(buf, ~0)); + ret = ff_filter_samples(link, buf); break; default: + avfilter_unref_bufferp(&buf); return AVERROR(EINVAL); } -fail: - avfilter_unref_buffer(buf); - return ret; } |