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

mmdevice: scale volume as other Windows plugins

parent 7087f3bf
......@@ -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
......
......@@ -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;
......
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