Skip to content

Commit be9a2e9

Browse files
committed
ALSA: x86: Stop the stream when buffer is processed after disconnection
This shouldn't happen, but just to be sure... Signed-off-by: Takashi Iwai <[email protected]>
1 parent 28ed125 commit be9a2e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sound/x86/intel_hdmi_audio.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -971,19 +971,22 @@ static void had_process_buffer_done(struct snd_intelhad *intelhaddata)
971971
{
972972
struct snd_pcm_substream *substream;
973973

974-
if (!intelhaddata->connected)
975-
return; /* disconnected? - bail out */
976-
977974
substream = had_substream_get(intelhaddata);
978975
if (!substream)
979976
return; /* no stream? - bail out */
980977

978+
if (!intelhaddata->connected) {
979+
snd_pcm_stop_xrun(substream);
980+
goto out; /* disconnected? - bail out */
981+
}
982+
981983
/* process or stop the stream */
982984
if (had_process_ringbuf(substream, intelhaddata) < 0)
983985
snd_pcm_stop_xrun(substream);
984986
else
985987
snd_pcm_period_elapsed(substream);
986988

989+
out:
987990
had_substream_put(intelhaddata);
988991
}
989992

0 commit comments

Comments
 (0)