mixin-mixout: fix frames-to-produce calculation

When calculating the number of frames to produce, ignore inactive and
empty inputs. On the one hand an inactive empty input shouldn't block
producing data from active or non-empty inputs. OTOH if an inactive
input has pending data, it should be used instead of letting the data
stall.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2023-02-20 17:03:23 +01:00 committed by Liam Girdwood
parent f141b6017e
commit 2417f0bc6d
1 changed files with 3 additions and 1 deletions

View File

@ -512,7 +512,9 @@ static int mixout_process(struct processing_module *mod,
continue;
pending_frames = md->pending_frames[source_index];
frames_to_produce = MIN(frames_to_produce, pending_frames);
if (source->state == COMP_STATE_ACTIVE || pending_frames)
frames_to_produce = MIN(frames_to_produce, pending_frames);
}
if (frames_to_produce > 0 && frames_to_produce < INT32_MAX) {