[FFmpeg-cvslog] af_amix: avoid spurious EAGAIN.

Anton Khirnov git at videolan.org
Sat Jul 7 03:02:43 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Jul  5 21:51:44 2012 +0200| [b7558ac293f199ac408117618a61567ee1ee7077] | committer: Anton Khirnov

af_amix: avoid spurious EAGAIN.

Input on/off state can change in request_samples(), which can result in
a state where only the first input is active. get_available_samples()
will then return 0, and request_frame() will fail with EAGAIN even
though there is data on the single active input.

Take this into account and check the number of active inputs again after
calling request_samples().

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

 libavfilter/af_amix.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index deeaa03..439231f 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -437,7 +437,9 @@ static int request_frame(AVFilterLink *outlink)
         ret = calc_active_inputs(s);
         if (ret < 0)
             return ret;
+    }
 
+    if (s->active_inputs > 1) {
         available_samples = get_available_samples(s);
         if (!available_samples)
             return AVERROR(EAGAIN);



More information about the ffmpeg-cvslog mailing list