diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-05 23:51:44 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-06 15:51:58 +0400 |
commit | b7558ac293f199ac408117618a61567ee1ee7077 (patch) | |
tree | 0c04520b6b5ea0f4fc095e896444fdabb92296a8 /libavfilter | |
parent | 54bf88e65fe2d87a41abcbee33392725ebe2f0a0 (diff) |
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().
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_amix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index deeaa036ac..439231fbd1 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); |