summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-09-01 12:47:16 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-09-17 13:21:01 (GMT)
commit7eb0aea6d3d261b97d224b5342fac1637cb9b792 (patch)
tree0c6751bbcadbef6321b882600849d2043ac595e0 /src/multimedia
parentf43ec0dc8414d7342f02269fdc5cd6ac7b7ec44f (diff)
downloadQt-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.cpp17
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;
}