Skip to content

Commit da55a5c

Browse files
dp: look at all sinks and sources in default "is ready"
The default "is ready to process" implementation used to look at a first sink and first source only. This change makes it to look at all sinks and sources. Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
1 parent 3129eee commit da55a5c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

  • src/include/sof/audio/module_adapter/module

src/include/sof/audio/module_adapter/module/generic.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,15 @@ bool module_is_ready_to_process(struct processing_module *mod,
187187
/* default action - the module is ready if there's enough data for processing and enough
188188
* space to store result. IBS/OBS as declared in init_instance
189189
*/
190-
return (source_get_data_available(sources[0]) >= source_get_min_available(sources[0]) &&
191-
sink_get_free_size(sinks[0]) >= sink_get_min_free_space(sinks[0]));
190+
for (int i = 0; i < num_of_sources; i++)
191+
if (source_get_data_available(sources[i]) < source_get_min_available(sources[i]))
192+
return false;
193+
194+
for (int i = 0; i < num_of_sinks; i++)
195+
if (sink_get_free_size(sinks[i]) < sink_get_min_free_space(sinks[i]))
196+
return false;
197+
198+
return true;
192199
}
193200

194201
int module_process_sink_src(struct processing_module *mod,

0 commit comments

Comments
 (0)