diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-01-08 20:41:36 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-01-08 20:42:17 +0100 |
commit | 0ddc24d23248b5070c7fcdaee22c7852381fce1d (patch) | |
tree | a273ffc4d7657bfb70c515d3eb01f9a752ca333d /libavfilter/af_dynaudnorm.c | |
parent | 762bf6f4afa906a69366cbd125ef40fb788280de (diff) | |
download | ffmpeg-0ddc24d23248b5070c7fcdaee22c7852381fce1d.tar.gz |
avfilter/af_dynaudnorm: fix hang with too short input
The only thing we can do at such point is return samples unchanged.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/af_dynaudnorm.c')
-rw-r--r-- | libavfilter/af_dynaudnorm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index 91ec45a2da..ddbef26ab5 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -708,8 +708,15 @@ static int request_frame(AVFilterLink *outlink) ret = ff_request_frame(ctx->inputs[0]); - if (ret == AVERROR_EOF && !ctx->is_disabled && s->delay) - ret = flush_buffer(s, ctx->inputs[0], outlink); + if (ret == AVERROR_EOF && !ctx->is_disabled && s->delay) { + if (!cqueue_empty(s->gain_history_smoothed[0])) { + ret = flush_buffer(s, ctx->inputs[0], outlink); + } else if (s->queue.available) { + AVFrame *out = ff_bufqueue_get(&s->queue); + + ret = ff_filter_frame(outlink, out); + } + } return ret; } |