Commit c7bd556d authored by Justin Ruggles's avatar Justin Ruggles

lavfi: amix: check active input count before calling request_samples

fixes use of the amix filter with only 1 input
parent 6163d880
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment