Skip to content

Commit

Permalink
module_adapter: build params first then verify it
Browse files Browse the repository at this point in the history
We need to build params based on module base config first then we can
verify it. In comp_verify_params the params is applied to buffer so the
sequence is vital. And also remove redundant stream_param set.

Signed-off-by: Rander Wang <rander.wang@intel.com>
  • Loading branch information
RanderWang committed Dec 12, 2023
1 parent 240cc97 commit 7f6aaff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/audio/module_adapter/module_adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa
int ret;
struct processing_module *mod = comp_get_drvdata(dev);

module_adapter_set_params(mod, params);

ret = comp_verify_params(dev, mod->verify_params_flags, params);
if (ret < 0) {
comp_err(dev, "module_adapter_params(): comp_verify_params() failed.");
Expand Down Expand Up @@ -610,7 +612,6 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa
return ret;
}

module_adapter_set_params(mod, params);
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ void module_adapter_check_data(struct processing_module *mod, struct comp_dev *d
void module_adapter_set_params(struct processing_module *mod, struct sof_ipc_stream_params *params)
{
ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params);
ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, mod->stream_params);
}

int module_adapter_set_state(struct processing_module *mod, struct comp_dev *dev,
Expand Down

0 comments on commit 7f6aaff

Please sign in to comment.