[vlc-commits] mmdevice: scale volume as other Windows plugins

Rémi Denis-Courmont git at videolan.org
Fri Feb 7 21:42:57 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Feb  7 22:33:11 2014 +0200| [81055423a54c577b23e0b8cd40ad3a28b79cb1f7] | committer: Rémi Denis-Courmont

mmdevice: scale volume as other Windows plugins

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=81055423a54c577b23e0b8cd40ad3a28b79cb1f7
---

 modules/audio_output/Makefile.am |    2 +-
 modules/audio_output/mmdevice.c  |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/Makefile.am b/modules/audio_output/Makefile.am
index 9fb4700..52cd12f 100644
--- a/modules/audio_output/Makefile.am
+++ b/modules/audio_output/Makefile.am
@@ -58,7 +58,7 @@ aout_LTLIBRARIES += libjack_plugin.la
 endif
 
 libmmdevice_plugin_la_SOURCES = audio_output/mmdevice.c audio_output/mmdevice.h
-libmmdevice_plugin_la_LIBADD = -lole32
+libmmdevice_plugin_la_LIBADD = -lole32 $(LIBM)
 libwasapi_plugin_la_SOURCES = audio_output/wasapi.c
 libwasapi_plugin_la_LIBADD = -lole32 -lksuser
 if HAVE_WASAPI
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 2b5e332..394d4b3 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -29,6 +29,7 @@
 #define CONST_VTABLE
 
 #include <stdlib.h>
+#include <math.h>
 #include <assert.h>
 #include <audiopolicy.h>
 #include <mmdeviceapi.h>
@@ -181,6 +182,7 @@ static int VolumeSet(audio_output_t *aout, float vol)
 {
     aout_sys_t *sys = aout->sys;
 
+    vol = vol * vol * vol; /* ISimpleAudioVolume is tapered linearly. */
     EnterCriticalSection(&sys->lock);
     sys->volume = vol;
     WakeConditionVariable(&sys->work);
@@ -271,7 +273,7 @@ vlc_AudioSessionEvents_OnSimpleVolumeChanged(IAudioSessionEvents *this,
 
     msg_Dbg(aout, "simple volume changed: %f, muting %sabled", vol,
             mute ? "en" : "dis");
-    aout_VolumeReport(aout, vol);
+    aout_VolumeReport(aout, cbrtf(vol));
     aout_MuteReport(aout, mute == TRUE);
     (void) ctx;
     return S_OK;



More information about the vlc-commits mailing list