mirror of https://github.com/thesofproject/sof.git
volume: volume_cmd(): only stop/pause at running
We should only stop/pause it when the volume component is in running status. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
f3aec1d744
commit
7d0c7b6c1d
|
@ -429,10 +429,15 @@ static int volume_cmd(struct comp_dev *dev, int cmd, void *data)
|
|||
dev->state = COMP_STATE_RUNNING;
|
||||
break;
|
||||
case COMP_CMD_STOP:
|
||||
dev->state = COMP_STATE_SETUP;
|
||||
if (dev->state == COMP_STATE_RUNNING ||
|
||||
dev->state == COMP_STATE_DRAINING ||
|
||||
dev->state == COMP_STATE_PAUSED)
|
||||
dev->state = COMP_STATE_SETUP;
|
||||
break;
|
||||
case COMP_CMD_PAUSE:
|
||||
dev->state = COMP_STATE_PAUSED;
|
||||
/* only support pausing for running */
|
||||
if (dev->state == COMP_STATE_RUNNING)
|
||||
dev->state = COMP_STATE_PAUSED;
|
||||
break;
|
||||
case COMP_CMD_RELEASE:
|
||||
dev->state = COMP_STATE_RUNNING;
|
||||
|
|
Loading…
Reference in New Issue