Ignore pipeline_prepare() calls when the pipeline is running already. This is to prevent errors in the case of hostless pipelines when the user tries to enable the pipeline when it is already active.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- src/audio/pipeline.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index a59e4ea..f014aa5 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -382,6 +382,11 @@ static int component_op_downstream(struct op_data *op_data, op_data->cmd); break; case COMP_OPS_PREPARE: + + /* don't do prepare downstream if current is running */ + if (current->state == COMP_STATE_ACTIVE) + return 0; + /* prepare the component */ err = comp_prepare(current); break;