mirror of https://github.com/thesofproject/sof.git
pipeline: add a flag to indicate if the buffer is being traversed
Add a flag 'walking' to the buffer struct, to indicate if the buffer is just being traversed while walking through the graph, and don't go back to the buffer which is already walked. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
2ae18268a8
commit
968eaf1621
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue