mirror of
https://github.com/mpv-player/mpv
synced 2025-01-20 06:11:10 +00:00
command: format volume property as integer for OSD
The value range is 0-100, so fractional values don't make much sense. But the underlying data type is probably float to avoid getting "stuck" when doing small volume increments. So step this around and pretend it's an integer just on display.
This commit is contained in:
parent
8a51a6b79c
commit
b4fb71634c
@ -916,6 +916,12 @@ static int mp_property_volume(m_option_t *prop, int action, void *arg,
|
||||
case M_PROPERTY_GET:
|
||||
mixer_getbothvolume(mpctx->mixer, arg);
|
||||
return M_PROPERTY_OK;
|
||||
case M_PROPERTY_PRINT: {
|
||||
float val;
|
||||
mixer_getbothvolume(mpctx->mixer, &val);
|
||||
*(char **)arg = talloc_asprintf(NULL, "%i", (int)val);
|
||||
return M_PROPERTY_OK;
|
||||
}
|
||||
case M_PROPERTY_SET:
|
||||
if (!mixer_audio_initialized(mpctx->mixer))
|
||||
return M_PROPERTY_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user