Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,9 @@ int module_bind(struct processing_module *mod, struct bind_info *bind_data)
switch (bind_data->bind_type) {
case COMP_BIND_TYPE_SINK:
ret = sink_bind(bind_data->sink, mod);
mod->num_of_sinks++;
break;
case COMP_BIND_TYPE_SOURCE:
ret = source_bind(bind_data->source, mod);
mod->num_of_sources++;
break;
default:
ret = -EINVAL;
Expand All @@ -749,11 +747,9 @@ int module_unbind(struct processing_module *mod, struct bind_info *unbind_data)
switch (unbind_data->bind_type) {
case COMP_BIND_TYPE_SINK:
ret = sink_unbind(unbind_data->sink);
mod->num_of_sinks--;
break;
case COMP_BIND_TYPE_SOURCE:
ret = source_unbind(unbind_data->source);
mod->num_of_sources--;
break;
default:
ret = -EINVAL;
Expand Down
13 changes: 13 additions & 0 deletions src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@ int module_adapter_prepare(struct comp_dev *dev)
if (IS_PROCESSING_MODE_SINK_SOURCE(mod))
return 0;

/* compute number of input buffers */
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable blist is used in the list_for_item macro but is not declared. This will cause a compilation error.

Suggested change
/* compute number of input buffers */
/* compute number of input buffers */
struct list_item *blist;

Copilot uses AI. Check for mistakes.
mod->num_of_sources = 0;
list_for_item(blist, &dev->bsource_list)
mod->num_of_sources++;

/* compute number of output buffers */
mod->num_of_sinks = 0;
list_for_item(blist, &dev->bsink_list)
mod->num_of_sinks++;
Comment on lines +321 to +324
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable blist is used in the list_for_item macro but is not declared. This will cause a compilation error.

Copilot uses AI. Check for mistakes.

if (!mod->num_of_sources && !mod->num_of_sinks) {
comp_err(dev, "no source and sink buffers connected!");
return -EINVAL;
Expand Down Expand Up @@ -1212,6 +1222,9 @@ int module_adapter_reset(struct comp_dev *dev)
if (IS_PROCESSING_MODE_RAW_DATA(mod) || IS_PROCESSING_MODE_AUDIO_STREAM(mod)) {
rfree(mod->output_buffers);
rfree(mod->input_buffers);

mod->num_of_sources = 0;
mod->num_of_sinks = 0;
}

mod->total_data_consumed = 0;
Expand Down
Loading