summaryrefslogtreecommitdiff
path: root/libavfilter/af_atempo.c
diff options
context:
space:
mode:
authorPavel Koshevoy <pkoshevoy@gmail.com>2014-08-19 00:17:59 -0600
committerMichael Niedermayer <michaelni@gmx.at>2014-08-19 12:53:09 +0200
commit6380f2e3670a8cfc29b9b02da0f2be0c537315f8 (patch)
tree5540ab991587a2220e4f3781341299663f28e238 /libavfilter/af_atempo.c
parentc9a5497a0b4d61898458c6883cea83bac29d1057 (diff)
avfilter/atempo: Flush all buffered input samples
Fixes ticket #3829 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_atempo.c')
-rw-r--r--libavfilter/af_atempo.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 6a3fd61e60..fcd0cb0693 100644
--- a/libavfilter/af_atempo.c
+++ b/libavfilter/af_atempo.c
@@ -949,7 +949,13 @@ static int yae_flush(ATempoContext *atempo,
}
}
- // flush the remaininder of the current fragment:
+ // check whether all of the input samples have been consumed:
+ if (frag->position[0] + frag->nsamples < atempo->position[0]) {
+ yae_advance_to_next_frag(atempo);
+ return AVERROR(EAGAIN);
+ }
+
+ // flush the remainder of the current fragment:
start_here = FFMAX(atempo->position[1], overlap_end);
stop_here = frag->position[1] + frag->nsamples;
offset = start_here - frag->position[1];