From c8727ed9fcdf55f05b09ed04bc6aa1129a080543 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 16 Dec 2014 05:07:38 +0100 Subject: 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. --- player/command.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- cgit v1.2.3