diff options
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_amix.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index 3399b7c..d4af9a4 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -389,6 +389,10 @@ static int request_frame(AVFilterLink *outlink) int ret; int wanted_samples, available_samples; + ret = calc_active_inputs(s); + if (ret < 0) + return ret; + if (s->input_state[0] == INPUT_OFF) { ret = request_samples(ctx, 1); if (ret < 0) @@ -419,15 +423,16 @@ static int request_frame(AVFilterLink *outlink) av_assert0(s->frame_list->nb_frames > 0); wanted_samples = frame_list_next_frame_size(s->frame_list); - ret = request_samples(ctx, wanted_samples); - if (ret < 0) - return ret; - - ret = calc_active_inputs(s); - if (ret < 0) - return ret; if (s->active_inputs > 1) { + ret = request_samples(ctx, wanted_samples); + if (ret < 0) + return ret; + + ret = calc_active_inputs(s); + if (ret < 0) + return ret; + available_samples = get_available_samples(s); if (!available_samples) return 0; |