Commit 4715ec52 authored by Bill Somerville's avatar Bill Somerville Committed by The Qt Project
Browse files

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: default avatarAlex Blasche <alexander.blasche@digia.com>
Reviewed-by: default avatarYoann Lopes <yoann.lopes@digia.com>
parent 13a53a50
No related merge requests found
Showing with 1 addition and 1 deletion
...@@ -702,7 +702,7 @@ void QAudioOutputPrivate::setVolume(qreal v) ...@@ -702,7 +702,7 @@ void QAudioOutputPrivate::setVolume(qreal v)
volumeCache = normalizedVolume; volumeCache = normalizedVolume;
return; return;
} }
const qint16 scaled = normalizedVolume * 0xFFFF; const quint16 scaled = normalizedVolume * 0xFFFF;
DWORD vol = MAKELONG(scaled, scaled); DWORD vol = MAKELONG(scaled, scaled);
MMRESULT res = waveOutSetVolume(hWaveOut, vol); MMRESULT res = waveOutSetVolume(hWaveOut, vol);
if (res == MMSYSERR_NOERROR) if (res == MMSYSERR_NOERROR)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment