summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-27 00:57:41 +0100
committerwm4 <wm4@nowhere>2014-02-27 00:57:41 +0100
commitb4fb71634cf746cfd9ba19c1260dbc0aee38700e (patch)
treee6b111ae32465cb9bd2e1ed7103fe70e014c3de1 /player
parent8a51a6b79c2790d97aed2dd107ed1f3a70f95236 (diff)
downloadmpv-b4fb71634cf746cfd9ba19c1260dbc0aee38700e.tar.bz2
mpv-b4fb71634cf746cfd9ba19c1260dbc0aee38700e.tar.xz
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.
Diffstat (limited to 'player')
-rw-r--r--player/command.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index feaf4788d2..7712a6e550 100644
--- a/player/command.c
+++ b/player/command.c
@@ -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;