From 0ec11e3393095dc242030825a6a18dc89e196f99 Mon Sep 17 00:00:00 2001 From: VaL Doroshchuk Date: Thu, 25 Jan 2018 14:28:16 +0100 Subject: PulseAudioOutput: Emit QAudio::StoppedState on QAudio::OpenError If a problem occurs in open() the stateChanged() signal should be explicitly emitted regardless that current state has not been changed since QAudio::StoppedState. Task-number: QTBUG-49569 Change-Id: I6f4e235fa4b6b3bbf0dc3946dfe1f983ac10f356 Reviewed-by: Christian Stromme --- src/plugins/pulseaudio/qaudiooutput_pulse.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index 3c20908dc..38cf54979 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -276,6 +276,7 @@ bool QPulseAudioOutput::open() if (!pulseEngine->context() || pa_context_get_state(pulseEngine->context()) != PA_CONTEXT_READY) { setError(QAudio::FatalError); setState(QAudio::StoppedState); + emit stateChanged(m_deviceState); return false; } @@ -284,6 +285,7 @@ bool QPulseAudioOutput::open() if (!pa_sample_spec_valid(&spec)) { setError(QAudio::OpenError); setState(QAudio::StoppedState); + emit stateChanged(m_deviceState); return false; } @@ -336,6 +338,7 @@ bool QPulseAudioOutput::open() pulseEngine->unlock(); setError(QAudio::OpenError); setState(QAudio::StoppedState); + emit stateChanged(m_deviceState); return false; } -- cgit v1.2.3