mirror of https://github.com/thesofproject/sof.git
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:
parent
820ef37c82
commit
9a89f4eb80
|
@ -258,21 +258,23 @@ int module_process(struct comp_dev *dev)
|
||||||
|
|
||||||
comp_dbg(dev, "module_process() start");
|
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",
|
comp_err(dev, "module_process(): wrong state of module %x, state %d",
|
||||||
mod->ca_config.module_id, md->state);
|
mod->ca_config.module_id, md->state);
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* set state to processing */
|
||||||
|
md->state = MODULE_PROCESSING;
|
||||||
|
|
||||||
ret = md->ops->process(dev);
|
ret = md->ops->process(dev);
|
||||||
if (ret) {
|
if (ret)
|
||||||
comp_err(dev, "module_process() error %d: for module_id %x",
|
comp_err(dev, "module_process() error %d: for module_id %x",
|
||||||
ret, module_id);
|
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;
|
md->state = MODULE_IDLE;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue