aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-02-15 16:05:34 -0500
committerTakashi Iwai <tiwai@suse.de>2017-02-16 03:22:43 -0500
commitbe9a2e933e301bec856d526516801e14247519c5 (patch)
treedd479337bf8ddbac9849478748dd4f899cadd054
parent28ed125b9a07b9ad09ea680628a920427d079af6 (diff)
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 <tiwai@suse.de>
-rw-r--r--sound/x86/intel_hdmi_audio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index 8d365718c692..8d67031e8429 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -971,19 +971,22 @@ static void had_process_buffer_done(struct snd_intelhad *intelhaddata)
971{ 971{
972 struct snd_pcm_substream *substream; 972 struct snd_pcm_substream *substream;
973 973
974 if (!intelhaddata->connected)
975 return; /* disconnected? - bail out */
976
977 substream = had_substream_get(intelhaddata); 974 substream = had_substream_get(intelhaddata);
978 if (!substream) 975 if (!substream)
979 return; /* no stream? - bail out */ 976 return; /* no stream? - bail out */
980 977
978 if (!intelhaddata->connected) {
979 snd_pcm_stop_xrun(substream);
980 goto out; /* disconnected? - bail out */
981 }
982
981 /* process or stop the stream */ 983 /* process or stop the stream */
982 if (had_process_ringbuf(substream, intelhaddata) < 0) 984 if (had_process_ringbuf(substream, intelhaddata) < 0)
983 snd_pcm_stop_xrun(substream); 985 snd_pcm_stop_xrun(substream);
984 else 986 else
985 snd_pcm_period_elapsed(substream); 987 snd_pcm_period_elapsed(substream);
986 988
989 out:
987 had_substream_put(intelhaddata); 990 had_substream_put(intelhaddata);
988} 991}
989 992