Skip to content

Commit

Permalink
ao_wasapi: scale queried AO volume to (0, 100)
Browse files Browse the repository at this point in the history
This was done for `AOCONTROL_SET_VOLUME` but not `AOCONTROL_GET_VOLUME`.
  • Loading branch information
sunpenghao authored and Dudemanguy committed Feb 24, 2024
1 parent 6863eef commit 2cc3bc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions audio/out/ao_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2cc3bc1

Please sign in to comment.