summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-12-18 12:02:41 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-18 15:22:33 +0300
commit0bfa6e5b16a31f4218c12d8ab7f2064d8ab96e2f (patch)
tree0044e4222f409a0b6a351ef9871e6b50edf882de /sound
parent125c50411b6df22afee8bb353b524f96b2ea71e8 (diff)
downloadlinux-0bfa6e5b16a31f4218c12d8ab7f2064d8ab96e2f.tar.xz
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_native.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 175dca44c97e..707405cbc5c9 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1404,6 +1404,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: