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 13:21:01 (GMT) |
commit | 7eb0aea6d3d261b97d224b5342fac1637cb9b792 (patch) | |
tree | 0c6751bbcadbef6321b882600849d2043ac595e0 /src/multimedia | |
parent | f43ec0dc8414d7342f02269fdc5cd6ac7b7ec44f (diff) | |
download | Qt-7eb0aea6d3d261b97d224b5342fac1637cb9b792.zip Qt-7eb0aea6d3d261b97d224b5342fac1637cb9b792.tar.gz Qt-7eb0aea6d3d261b97d224b5342fac1637cb9b792.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; } |