Skip to content

Commit

Permalink
[ALSA] Fix substream to check in PCM drain
Browse files Browse the repository at this point in the history
The check of a substream in snd_pcm_drain() might not be always correct
since runtime can point a different substream (although the PCM state
of each linked substream should be same, in theory).
This patch fixes it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jul 20, 2007
1 parent 940d244 commit 1a7fa54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/pcm_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream)

snd_pcm_stream_lock_irq(substream);
/* resume pause */
if (runtime->status->state == SNDRV_PCM_STATE_PAUSED)
if (substream->runtime->status->state == SNDRV_PCM_STATE_PAUSED)
snd_pcm_pause(substream, 0);

/* pre-start/stop - all running streams are changed to DRAINING state */
Expand Down

0 comments on commit 1a7fa54

Please sign in to comment.