Skip to content

Commit 5d6cabf

Browse files
committed
module_adapter: Count sinks/sources during bind
In preparation for preparing modules during the bind phase instead of pipeline trigger, move the code to count of the sinks/sources as and when they are connected. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent ae535ea commit 5d6cabf

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/audio/module_adapter/module/generic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,11 @@ int module_bind(struct processing_module *mod, struct bind_info *bind_data)
723723
switch (bind_data->bind_type) {
724724
case COMP_BIND_TYPE_SINK:
725725
ret = sink_bind(bind_data->sink, mod);
726+
mod->num_of_sinks++;
726727
break;
727728
case COMP_BIND_TYPE_SOURCE:
728729
ret = source_bind(bind_data->source, mod);
730+
mod->num_of_sources++;
729731
break;
730732
default:
731733
ret = -EINVAL;

src/audio/module_adapter/module_adapter.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,6 @@ int module_adapter_prepare(struct comp_dev *dev)
313313
if (IS_PROCESSING_MODE_SINK_SOURCE(mod))
314314
return 0;
315315

316-
/* compute number of input buffers */
317-
mod->num_of_sources = 0;
318-
list_for_item(blist, &dev->bsource_list)
319-
mod->num_of_sources++;
320-
321-
/* compute number of output buffers */
322-
mod->num_of_sinks = 0;
323-
list_for_item(blist, &dev->bsink_list)
324-
mod->num_of_sinks++;
325-
326316
if (!mod->num_of_sources && !mod->num_of_sinks) {
327317
comp_err(dev, "no source and sink buffers connected!");
328318
return -EINVAL;

0 commit comments

Comments
 (0)