summaryrefslogtreecommitdiff
path: root/src/multimedia/audio
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-09-20 14:39:31 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-01-24 13:08:43 +0000
commitf4ed0d4178ecdf50cdaca47716a5101a28494157 (patch)
tree355756a3c11ff88e442904467997081da579a495 /src/multimedia/audio
parent363f8b088f59f3e5465198d4c525cc4dbcaa9439 (diff)
downloadqtmultimedia-f4ed0d4178ecdf50cdaca47716a5101a28494157.tar.gz
PulseAudio: Prevent crash when a sound device cannot be created
Change-Id: I74436b9e8903dd3d38926497594ee195f31c81e6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r--src/multimedia/audio/qsoundeffect_pulse_p.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
index 1e9204598..a4861d2a9 100644
--- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp
@@ -362,7 +362,8 @@ QSoundEffectPrivate::QSoundEffectPrivate(QObject* parent):
pulseDaemon()->ref();
m_ref = new QSoundEffectRef(this);
- pa_sample_spec_init(&m_pulseSpec);
+ if (pulseDaemon()->context())
+ pa_sample_spec_init(&m_pulseSpec);
m_resources = QMediaResourcePolicy::createResourceSet<QMediaPlayerResourceSetInterface>();
Q_ASSERT(m_resources);