diff options
author | wm4 <wm4@nowhere> | 2014-12-16 05:07:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-16 05:07:38 +0100 |
commit | c8727ed9fcdf55f05b09ed04bc6aa1129a080543 (patch) | |
tree | f4ee9c861cb7f6e12d0b39c4f01461dcb57c60df /player | |
parent | af3bbb800d709f81c9f30bc4ced26c98ea5eafd6 (diff) | |
download | mpv-c8727ed9fcdf55f05b09ed04bc6aa1129a080543.tar.bz2 mpv-c8727ed9fcdf55f05b09ed04bc6aa1129a080543.tar.xz |
command: format ${avsync} like on terminal status line
Padding with spaces is very useless for OSD (because most fonts are
variable width), but it's good when using it on the terminal, e.g. for
reproducing the default terminal status line.
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index febbb785b0..dc26c354ae 100644 --- a/player/command.c +++ b/player/command.c @@ -506,6 +506,10 @@ static int mp_property_avsync(void *ctx, struct m_property *prop, return M_PROPERTY_UNAVAILABLE; if (mpctx->last_av_difference == MP_NOPTS_VALUE) return M_PROPERTY_UNAVAILABLE; + if (action == M_PROPERTY_PRINT) { + *(char **)arg = talloc_asprintf(NULL, "%7.3f", mpctx->last_av_difference); + return M_PROPERTY_OK; + } return m_property_double_ro(action, arg, mpctx->last_av_difference); } |