diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-06-30 10:11:22 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-06-30 14:03:54 +0200 |
commit | 0689d5e17ac0a3269c604b4df2c01140be328647 (patch) | |
tree | b13f02db581e86c23feeaeffa396503ef37cef0c /libavfilter/avfilter.c | |
parent | c9c4835f5164b86510591d4ba604bfb448c7a356 (diff) | |
download | ffmpeg-0689d5e17ac0a3269c604b4df2c01140be328647.tar.gz |
lavfi: implement samples framing on links.
Links can be set up to group samples into buffers of
specified minimum and maximum size.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 0474192b1a..01f34423c9 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -28,6 +28,7 @@ #include "avfilter.h" #include "formats.h" #include "internal.h" +#include "audio.h" char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms) { @@ -320,13 +321,20 @@ void ff_tlog_link(void *ctx, AVFilterLink *link, int end) int ff_request_frame(AVFilterLink *link) { + int ret = -1; FF_TPRINTF_START(NULL, request_frame); ff_tlog_link(NULL, link, 1); if (link->srcpad->request_frame) - return link->srcpad->request_frame(link); + ret = link->srcpad->request_frame(link); else if (link->src->inputs[0]) - return ff_request_frame(link->src->inputs[0]); - else return -1; + ret = ff_request_frame(link->src->inputs[0]); + if (ret == AVERROR_EOF && link->partial_buf) { + AVFilterBufferRef *pbuf = link->partial_buf; + link->partial_buf = NULL; + ff_filter_samples_framed(link, pbuf); + return 0; + } + return ret; } int ff_poll_frame(AVFilterLink *link) |