[Sound-open-firmware] [PATCH v3 18/27] volume: volume_cmd(): only stop/pause at running
Keyon Jie
yang.jie at linux.intel.com
Sat Feb 11 03:17:58 CET 2017
We should only stop/pause it when the volume component is in
running status.
Signed-off-by: Keyon Jie <yang.jie at linux.intel.com>
---
src/audio/volume.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/audio/volume.c b/src/audio/volume.c
index 03e9dd4..ee49b3a 100644
--- a/src/audio/volume.c
+++ b/src/audio/volume.c
@@ -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;
--
2.7.4
More information about the Sound-open-firmware
mailing list