codec_adapter: fix states before and after processing

set the state to MODULE_PROCESSING before starting to process the
samples and reset it to MODULE_IDLE afterwards.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
Ranjani Sridharan 2022-01-10 14:34:16 -08:00 committed by Liam Girdwood
parent 820ef37c82
commit 9a89f4eb80
1 changed files with 8 additions and 6 deletions

View File

@ -258,21 +258,23 @@ int module_process(struct comp_dev *dev)
comp_dbg(dev, "module_process() start");
if (mod->priv.state != MODULE_IDLE) {
if (md->state != MODULE_IDLE) {
comp_err(dev, "module_process(): wrong state of module %x, state %d",
mod->ca_config.module_id, md->state);
return -EPERM;
}
/* set state to processing */
md->state = MODULE_PROCESSING;
ret = md->ops->process(dev);
if (ret) {
if (ret)
comp_err(dev, "module_process() error %d: for module_id %x",
ret, module_id);
goto out;
}
else
comp_dbg(dev, "module_process() done");
comp_dbg(dev, "module_process() done");
out:
/* reset state to idle */
md->state = MODULE_IDLE;
return ret;
}