WMF: fix start time of buffers provided by QAudioDecoder.
authorYoann Lopes <yoann.lopes@theqtcompany.com>
Thu, 16 Apr 2015 09:30:08 +0000 (11:30 +0200)
committerYoann Lopes <yoann.lopes@theqtcompany.com>
Tue, 19 May 2015 11:41:42 +0000 (11:41 +0000)
The time was in milliseconds but should be in microseconds.

Task-number: QTBUG-45571
Change-Id: I54f07975e7a6233254a338dcde8075f740b5455c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp

index e3d1ebd..55fae71 100644 (file)
@@ -389,7 +389,8 @@ void MFAudioDecoderControl::handleSampleAdded()
             s->Release();
         }
     }
-    m_cachedAudioBuffer = QAudioBuffer(abuf, m_audioFormat, qint64(sampleStartTime / 10000));
+    // WMF uses 100-nanosecond units, QAudioDecoder uses milliseconds, QAudioBuffer uses microseconds...
+    m_cachedAudioBuffer = QAudioBuffer(abuf, m_audioFormat, qint64(sampleStartTime / 10));
     m_bufferReady = true;
     emit positionChanged(m_position);
     emit bufferAvailableChanged(m_bufferReady);