diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-09-01 12:47:16 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-09-17 12:33:02 (GMT) |
commit | 7ed96ae38b3eaee5988ac4d4717ff5c7611d0f15 (patch) | |
tree | 70dc8664997df8a8c48463ca86d05587908258fc /src/multimedia | |
parent | 496f49b4398f8ff70e50236a71b1b221183171ca (diff) | |
download | Qt-7ed96ae38b3eaee5988ac4d4717ff5c7611d0f15.zip Qt-7ed96ae38b3eaee5988ac4d4717ff5c7611d0f15.tar.gz Qt-7ed96ae38b3eaee5988ac4d4717ff5c7611d0f15.tar.bz2 |
Permit QAudioOutput::processedUSecs() to be called immediately after start()
If QAudioOutput::processedUSecs() is called very soon after
QAudioOutput::start(), the DevSound instance owned by the Symbian
backend may still be initializing. This patch causes the function to
return zero, rather than failing an assertion.
Task-number: QTBUG-13059
Reviewed-by: Derick Hawcroft
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/audio/qaudio_symbian_p.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/multimedia/audio/qaudio_symbian_p.cpp b/src/multimedia/audio/qaudio_symbian_p.cpp index 4522c5c..ae58b94 100644 --- a/src/multimedia/audio/qaudio_symbian_p.cpp +++ b/src/multimedia/audio/qaudio_symbian_p.cpp @@ -432,15 +432,16 @@ bool DevSoundWrapper::isFormatSupported(const QAudioFormat &format) const int DevSoundWrapper::samplesProcessed() const { - Q_ASSERT(StateInitialized == m_state); int result = 0; - switch (m_mode) { - case QAudio::AudioInput: - result = m_devsound->SamplesRecorded(); - break; - case QAudio::AudioOutput: - result = m_devsound->SamplesPlayed(); - break; + if (StateInitialized == m_state) { + switch (m_mode) { + case QAudio::AudioInput: + result = m_devsound->SamplesRecorded(); + break; + case QAudio::AudioOutput: + result = m_devsound->SamplesPlayed(); + break; + } } return result; } |