From 6d2f9a2804d1f1be1e8c3c4cc1a9654217b6d0b2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 2 Jul 2013 08:07:15 +0200 Subject: ao_coreaudio: remove volume multiplication by 4 kHALOutputParam_Volume is the linear gain so it should be at maximum 1 to keep the audio quality good. No idea why it was more than that. --- audio/out/ao_coreaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 9206d31bf9..15dc2c9c69 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -152,7 +152,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) kAudioUnitScope_Global, 0, &vol); CHECK_CA_ERROR("could not get HAL output volume"); - control_vol->left = control_vol->right = vol * 100.0 / 4.0; + control_vol->left = control_vol->right = vol * 100.0; return CONTROL_TRUE; case AOCONTROL_SET_VOLUME: @@ -174,7 +174,7 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg) return CONTROL_TRUE; } - vol = (control_vol->left + control_vol->right) * 4.0 / 200.0; + vol = (control_vol->left + control_vol->right) / 200.0; err = AudioUnitSetParameter(p->audio_unit, kHALOutputParam_Volume, kAudioUnitScope_Global, 0, vol, 0); -- cgit v1.2.3