From b109f093d9bad84d54d5114735f311762f0eb42a Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 14 Apr 2015 13:42:46 +0200 Subject: 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 --- src/plugins/wmf/player/mfplayersession.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/wmf/player/mfplayersession.cpp') 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; -- cgit v1.2.3