From c9de25fa342ff8066d49541179c30d0ce45950b4 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 20 Jul 2016 13:15:20 +0200 Subject: PulseAudio (QSoundEffect): don't write data to an unready stream The PulseAudio stream must be ready to write data to it, otherwise an assert is raised. Change-Id: Iaa108124a135b018aa84845a37665895a005f380 Reviewed-by: Christian Stromme --- src/multimedia/audio/qsoundeffect_pulse_p.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index 48f3333c2..1fb10d121 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -736,6 +736,10 @@ void QSoundEffectPrivate::prepare() if (!m_pulseStream || !m_sampleReady) return; PulseDaemonLocker locker; + + if (pa_stream_get_state(m_pulseStream) != PA_STREAM_READY) + return; + pa_stream_set_write_callback(m_pulseStream, stream_write_callback, this); pa_stream_set_underflow_callback(m_pulseStream, stream_underrun_callback, this); m_stopping = false; -- cgit v1.2.3