Skip to content

Commit

Permalink
component:refine the state machine for state transform.
Browse files Browse the repository at this point in the history
1. when component is at PAUSED, it will not receive START
command from host or DSP internal.
2. when the component is at PAUSED, it would receive STOP
command from host. we miss this point.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
  • Loading branch information
Wu Zhigang committed Jul 19, 2018
1 parent 1f1c9ed commit 5198517
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/audio/component.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ int comp_set_state(struct comp_dev *dev, int cmd)

switch (cmd) {
case COMP_TRIGGER_START:
if (dev->state == COMP_STATE_PREPARE ||
dev->state == COMP_STATE_PAUSED) {
if (dev->state == COMP_STATE_PREPARE) {
dev->state = COMP_STATE_ACTIVE;
} else {
trace_comp_error("CES");
Expand All @@ -142,7 +141,8 @@ int comp_set_state(struct comp_dev *dev, int cmd)
break;
case COMP_TRIGGER_STOP:
case COMP_TRIGGER_XRUN:
if (dev->state == COMP_STATE_ACTIVE) {
if (dev->state == COMP_STATE_ACTIVE ||
dev->state == COMP_STATE_PAUSED) {
dev->state = COMP_STATE_PREPARE;
} else {
trace_comp_error("CEs");
Expand Down

0 comments on commit 5198517

Please sign in to comment.