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 <christian.stromme@qt.io>
This commit is contained in:
Yoann Lopes
2016-07-20 13:15:20 +02:00
parent c7ae48c5fb
commit c9de25fa34

View File

@@ -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;