Commit 5c437c34 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

WaveOut: map volume max to VLC max (fix #4554)

The formula should be changed in any case. WaveOut has a logarithmic
scale, which is not consistent with the other audio outputs.
parent 2d476ce7
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_charset.h> /* FromLocaleDup, LocaleFree */ #include <vlc_charset.h> /* FromLocaleDup, LocaleFree */
#include <vlc_atomic.h> #include <vlc_atomic.h>
...@@ -1003,8 +1004,13 @@ static int VolumeSet( audio_output_t * p_aout, float volume, bool mute ) ...@@ -1003,8 +1004,13 @@ static int VolumeSet( audio_output_t * p_aout, float volume, bool mute )
if( mute ) if( mute )
volume = 0.; volume = 0.;
unsigned long i_waveout_vol = volume * 0x7FFF; unsigned long i_waveout_vol = volume
i_waveout_vol = (i_waveout_vol << 16) | (i_waveout_vol & 0xFFFF); * (0xFFFF * AOUT_VOLUME_DEFAULT / AOUT_VOLUME_MAX);
if( i_waveout_vol <= 0xFFFF )
i_waveout_vol |= i_waveout_vol << 16;
else
i_waveout_vol = 0xFFFFFFFF;
#ifdef UNDER_CE #ifdef UNDER_CE
waveOutSetVolume( 0, i_waveout_vol ); waveOutSetVolume( 0, i_waveout_vol );
......
Markdown is supported
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