component:refine the state machine for state transform.

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>
This commit is contained in:
Wu Zhigang 2018-07-19 09:22:12 +08:00
parent 1f1c9ed2e5
commit 5198517136
1 changed files with 3 additions and 3 deletions

View File

@ -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");
@ -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");