From: Bill Somerville Date: Sat, 24 Aug 2013 19:51:24 +0000 (+0100) Subject: Fix QAudioOutput::setVolume() limited 50% on 32-bit Windows X-Git-Tag: upstream/5.2.95+rc1~52^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4715ec52b17a220c48a380a2cd1619ad5fb069a7;p=platform%2Fupstream%2Fqtmultimedia.git Fix QAudioOutput::setVolume() limited 50% on 32-bit Windows A signed 16 bit integer was being used to pack a normalised double into half of a DWORD. It needed to be unsigned 16-bit to get the full range of the Windows volume control. Task-number: QTBUG-33160 Change-Id: Ic17f572a188401ee686c6e6af3984d52328ccda6 Reviewed-by: Alex Blasche Reviewed-by: Yoann Lopes --- diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp index 4d13d43..286cecb 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.cpp +++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp @@ -702,7 +702,7 @@ void QAudioOutputPrivate::setVolume(qreal v) volumeCache = normalizedVolume; return; } - const qint16 scaled = normalizedVolume * 0xFFFF; + const quint16 scaled = normalizedVolume * 0xFFFF; DWORD vol = MAKELONG(scaled, scaled); MMRESULT res = waveOutSetVolume(hWaveOut, vol); if (res == MMSYSERR_NOERROR)