summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-01-25 14:28:16 +0100
committerVaL Doroshchuk <valentyn.doroshchuk@qt.io>2018-04-12 11:08:35 +0000
commit0ec11e3393095dc242030825a6a18dc89e196f99 (patch)
tree033c3d6694822292c25e0cc420d77a104fbc9bef
parentc96b95e50e71dfae82de5b822e7ab758787acd47 (diff)
PulseAudioOutput: Emit QAudio::StoppedState on QAudio::OpenErrorv5.11.0-beta4
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 <christian.stromme@qt.io>
-rw-r--r--src/plugins/pulseaudio/qaudiooutput_pulse.cpp3
1 files changed, 3 insertions, 0 deletions
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;
}