diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-12-18 10:02:41 +0100 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2015-06-19 11:40:18 +0800 |
commit | 7ea0e7edc3045ee48b962e2fe5444f325f3d8c47 (patch) | |
tree | e9ce880c067271b135628d8872e2e6b63698e9aa /sound | |
parent | 1df722f5eca4d75256f4bee1c495f14f0c10892f (diff) |
ALSA: pcm: Don't leave PREPARED state after draining
commit 70372a7566b5e552dbe48abdac08c275081d8558 upstream.
When a PCM draining is performed to an empty stream that has been
already in PREPARED state, the current code just ignores and leaves as
it is, although the drain is supposed to set all such streams to SETUP
state. This patch covers that overlooked case.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/core/pcm_native.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 3a907935fa09..65195a1b3da6 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1382,6 +1382,8 @@ static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, int state) if (! snd_pcm_playback_empty(substream)) { snd_pcm_do_start(substream, SNDRV_PCM_STATE_DRAINING); snd_pcm_post_start(substream, SNDRV_PCM_STATE_DRAINING); + } else { + runtime->status->state = SNDRV_PCM_STATE_SETUP; } break; case SNDRV_PCM_STATE_RUNNING: |