[FFmpeg-cvslog] avfilter/atempo: Flush all buffered input samples

Pavel Koshevoy git at videolan.org
Tue Aug 19 13:03:05 CEST 2014


ffmpeg | branch: master | Pavel Koshevoy <pkoshevoy at gmail.com> | Tue Aug 19 00:17:59 2014 -0600| [6380f2e3670a8cfc29b9b02da0f2be0c537315f8] | committer: Michael Niedermayer

avfilter/atempo: Flush all buffered input samples

Fixes ticket #3829

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6380f2e3670a8cfc29b9b02da0f2be0c537315f8
---

 libavfilter/af_atempo.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_atempo.c b/libavfilter/af_atempo.c
index 6a3fd61..fcd0cb0 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];



More information about the ffmpeg-cvslog mailing list