0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-19 19:42:24 +02:00

ao_wasapi: scale queried AO volume to (0, 100)

This was done for `AOCONTROL_SET_VOLUME` but not `AOCONTROL_GET_VOLUME`.
This commit is contained in:
sunpenghao 2024-02-13 15:32:04 +08:00 committed by Dudemanguy
parent 6863eefc3d
commit 2cc3bc12db

View File

@ -348,7 +348,7 @@ static int thread_control_exclusive(struct ao *ao, enum aocontrol cmd, void *arg
case AOCONTROL_GET_VOLUME:
IAudioEndpointVolume_GetMasterVolumeLevelScalar(
state->pEndpointVolume, &volume);
*(float *)arg = volume;
*(float *)arg = volume * 100.f;
return CONTROL_OK;
case AOCONTROL_SET_VOLUME:
volume = (*(float *)arg) / 100.f;
@ -378,7 +378,7 @@ static int thread_control_shared(struct ao *ao, enum aocontrol cmd, void *arg)
switch(cmd) {
case AOCONTROL_GET_VOLUME:
ISimpleAudioVolume_GetMasterVolume(state->pAudioVolume, &volume);
*(float *)arg = volume;
*(float *)arg = volume * 100.f;
return CONTROL_OK;
case AOCONTROL_SET_VOLUME:
volume = (*(float *)arg) / 100.f;