[Sound-open-firmware] [RFC PATCH 3/6] pipeline: ignore request for pipeline_prepare() if the pipeline is running

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Thu Jun 14 05:29:54 CEST 2018


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 at 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;
-- 
2.17.1



More information about the Sound-open-firmware mailing list