summaryrefslogtreecommitdiffstats
path: root/src/plugins/wmf/player/mfplayersession.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2015-04-14 13:42:46 +0200
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-04-14 14:30:16 +0000
commitb109f093d9bad84d54d5114735f311762f0eb42a (patch)
tree8d73fc6b4168116d97c13790febf8da7a58ab230 /src/plugins/wmf/player/mfplayersession.cpp
parentf3a07360dd5a7b8e8b13217b08a952a1584e8101 (diff)
WMF: fix reported sample type of 8-bit audio formats.
Always report 8-bit PCM data as unsigned integer. Even though there's no API to actually know that, it's standard on Windows. 8-bit is unsigned and 16-bit is signed. Task-number: QTBUG-45540 Change-Id: I4a3c09084de688ea7afc3bc147508184fb582224 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/wmf/player/mfplayersession.cpp')
-rw-r--r--src/plugins/wmf/player/mfplayersession.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/wmf/player/mfplayersession.cpp b/src/plugins/wmf/player/mfplayersession.cpp
index 599fa90c7..d6cf07ef4 100644
--- a/src/plugins/wmf/player/mfplayersession.cpp
+++ b/src/plugins/wmf/player/mfplayersession.cpp
@@ -556,7 +556,10 @@ QAudioFormat MFPlayerSession::audioFormatForMFMediaType(IMFMediaType *mediaType)
format.setSampleSize(wfx->wBitsPerSample);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
- format.setSampleType(QAudioFormat::SignedInt);
+ if (format.sampleSize() == 8)
+ format.setSampleType(QAudioFormat::UnSignedInt);
+ else
+ format.setSampleType(QAudioFormat::SignedInt);
CoTaskMemFree(wfx);
return format;