sound: fix volume change being reported to %mv tag on boot

Setting the last_volume_change time was moved here in
commit 2e08b0f82e ("sound: update global volume state
in sound_set_volume()"); however this also triggers the
%mv tag on boot, as if the user was actively changing
the volume.

Move the last_volume_change update back to the original
call sites to fix this.

Change-Id: I895112cea4315f194f67c27839f1082d67c1ffa9
This commit is contained in:
Aidan MacDonald 2025-10-03 09:54:46 +01:00
parent b19b95c00f
commit e24deccd00
3 changed files with 4 additions and 1 deletions

View file

@ -594,6 +594,9 @@ bool option_screen(const struct settings_list *setting,
if (!cb_on_changed || (*variable != oldvalue))
{
function(*variable);
/* if the volume is changing we need to let the skins know */
if (function == sound_get_fn(SOUND_VOLUME))
global_status.last_volume_change = current_tick;
}
}

View file

@ -879,6 +879,7 @@ void setvol(void)
volume = global_settings.volume_limit;
sound_set_volume(volume);
global_status.last_volume_change = current_tick;
status_save(false);
}