diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-15 09:26:14 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-15 09:26:14 +0200 |
commit | 1925bb404ec47b6e074c5e3b334fe0be12176d7b (patch) | |
tree | 8d7d79ac1b3a549c20bb4fa77c6f457bf1bb61ea /src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp | |
parent | 6187b72c51d0c05955d9d814baf8866b8e70fcfe (diff) | |
parent | f9145aca166ad2ca1514524ce88ded7834eb207c (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
src/multimedia/playback/playlistfileparser.cpp
src/plugins/windowsaudio/qwindowsaudiodeviceinfo.cpp
Change-Id: I52950def2b8283ae15797d05d4ead6a1256eba19
Diffstat (limited to 'src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp')
-rw-r--r-- | src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp index d0aed239a..e3d1ebde1 100644 --- a/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp +++ b/src/plugins/wmf/decoder/mfaudiodecodercontrol.cpp @@ -195,17 +195,6 @@ void MFAudioDecoderControl::handleMediaSourceReady() if (mediaType) { m_sourceOutputFormat = m_audioFormat; QAudioFormat af = m_audioFormat; - GUID subType; - if (SUCCEEDED(mediaType->GetGUID(MF_MT_SUBTYPE, &subType))) { - if (subType == MFAudioFormat_Float) { - m_sourceOutputFormat.setSampleType(QAudioFormat::Float); - } else { - m_sourceOutputFormat.setSampleType(QAudioFormat::SignedInt); - } - } - if (m_sourceOutputFormat.sampleType() != QAudioFormat::Float) { - m_sourceOutputFormat.setByteOrder(QAudioFormat::LittleEndian); - } UINT32 val = 0; if (SUCCEEDED(mediaType->GetUINT32(MF_MT_AUDIO_NUM_CHANNELS, &val))) { @@ -218,6 +207,20 @@ void MFAudioDecoderControl::handleMediaSourceReady() m_sourceOutputFormat.setSampleSize(int(val)); } + GUID subType; + if (SUCCEEDED(mediaType->GetGUID(MF_MT_SUBTYPE, &subType))) { + if (subType == MFAudioFormat_Float) { + m_sourceOutputFormat.setSampleType(QAudioFormat::Float); + } else if (m_sourceOutputFormat.sampleSize() == 8) { + m_sourceOutputFormat.setSampleType(QAudioFormat::UnSignedInt); + } else { + m_sourceOutputFormat.setSampleType(QAudioFormat::SignedInt); + } + } + if (m_sourceOutputFormat.sampleType() != QAudioFormat::Float) { + m_sourceOutputFormat.setByteOrder(QAudioFormat::LittleEndian); + } + if (m_audioFormat.sampleType() != QAudioFormat::Float && m_audioFormat.sampleType() != QAudioFormat::SignedInt) { af.setSampleType(m_sourceOutputFormat.sampleType()); |