Skip to content

Commit

Permalink
ipc4: mixin/mixout: Remove redundant buf size check
Browse files Browse the repository at this point in the history
The removed code may falsely fail for freq like 44.1 kHz.

Also, we generally do not check for sufficient buffer size in module
.prepare() handler. That should be/is done elsewhere. No need to do
the exception for mixout component.

Signed-off-by: Serhiy Katsyuba <[email protected]>
  • Loading branch information
serhiy-katsyuba-intel authored and kv2019i committed Jan 3, 2024
1 parent 7d961e1 commit 61b14a5
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/audio/mixin_mixout/mixin_mixout.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ static int mixout_params(struct processing_module *mod)
struct comp_buffer *sink;
struct comp_dev *dev = mod->dev;
enum sof_ipc_frame frame_fmt, valid_fmt;
uint32_t sink_period_bytes, sink_stream_size;
int ret;

comp_dbg(dev, "mixout_params()");
Expand All @@ -719,23 +718,6 @@ static int mixout_params(struct processing_module *mod)
audio_stream_set_valid_fmt(&sink->stream, valid_fmt);
audio_stream_set_channels(&sink->stream, params->channels);

sink_stream_size = audio_stream_get_size(&sink->stream);

/* calculate period size based on config */
sink_period_bytes = audio_stream_period_bytes(&sink->stream,
dev->frames);

if (sink_period_bytes == 0) {
comp_err(dev, "mixout_params(): period_bytes = 0");
return -EINVAL;
}

if (sink_stream_size < sink_period_bytes) {
comp_err(dev, "mixout_params(): sink buffer size %d is insufficient < %d",
sink_stream_size, sink_period_bytes);
return -ENOMEM;
}

return 0;
}

Expand Down

0 comments on commit 61b14a5

Please sign in to comment.