QSoundEffect: Set playing to true before starting the audio-device.

When the audio-device starts playing it should be able to read from the
source immediately. The OpenSL plugin would fail because the source was
blocking the audio-device from reading, as the state still was in its
initial state (stopped).

Change-Id: Ia26fa2eb442e239f5209947e6c9cd464b7d976a4
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
This commit is contained in:
Christian Strømme
2013-10-28 16:36:49 +01:00
committed by The Qt Project
parent 30cf028fb1
commit 852f684973

View File

@@ -236,10 +236,9 @@ void QSoundEffectPrivate::play()
setStatus(QSoundEffect::Null); setStatus(QSoundEffect::Null);
return; return;
} }
setPlaying(true);
if (d->m_audioOutput && d->m_audioOutput->state() == QAudio::StoppedState && d->m_sampleReady) if (d->m_audioOutput && d->m_audioOutput->state() == QAudio::StoppedState && d->m_sampleReady)
d->m_audioOutput->start(d); d->m_audioOutput->start(d);
setPlaying(true);
} }
void QSoundEffectPrivate::stop() void QSoundEffectPrivate::stop()