diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-09-20 14:39:31 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-01-24 13:08:43 +0000 |
commit | f4ed0d4178ecdf50cdaca47716a5101a28494157 (patch) | |
tree | 355756a3c11ff88e442904467997081da579a495 /src/multimedia/audio | |
parent | 363f8b088f59f3e5465198d4c525cc4dbcaa9439 (diff) | |
download | qtmultimedia-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.cpp | 3 |
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); |