8 Feb
2017
8 Feb
'17
1:09 p.m.
On Tue, 2017-02-07 at 22:03 +0800, Keyon Jie wrote:
We should only stop/pause it when the volume component is in running status.
Signed-off-by: Keyon Jie yang.jie@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 7a3f608..eb1530f 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;
indentation
break;
case COMP_CMD_PAUSE:
dev->state = COMP_STATE_PAUSED;
/* only support pausing for running */
if (dev->state == COMP_STATE_RUNNING)
break; case COMP_CMD_RELEASE: dev->state = COMP_STATE_RUNNING;dev->state = COMP_STATE_PAUSED;