diff --git a/src/audio/pipeline.c b/src/audio/pipeline.c index 1c255f4b9..d5f393a98 100644 --- a/src/audio/pipeline.c +++ b/src/audio/pipeline.c @@ -169,6 +169,10 @@ static int pipeline_for_each_comp(struct comp_dev *current, list_for_item(clist, buffer_list) { buffer = buffer_from_list(clist, struct comp_buffer, dir); + /* don't go back to the buffer which already walked */ + if (buffer->walking) + continue; + /* execute operation on buffer */ if (ctx->buff_func) ctx->buff_func(buffer, ctx->buff_data); @@ -182,8 +186,10 @@ static int pipeline_for_each_comp(struct comp_dev *current, /* continue further */ if (ctx->comp_func) { + buffer->walking = true; int err = ctx->comp_func(buffer_comp, buffer, ctx, dir); + buffer->walking = false; if (err < 0) return err; } diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index acd2e151c..5339dbcc7 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -111,6 +111,7 @@ struct comp_buffer { uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ bool hw_params_configured; /**< indicates whether hw params were set */ + bool walking; /**< indicates if the buffer is being walking */ }; struct buffer_cb_transact {