summaryrefslogtreecommitdiffstats
path: root/player/osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-18 00:12:59 +0200
committerwm4 <wm4@nowhere>2014-09-18 00:12:59 +0200
commita522441bbe6817798ca58b93d7adb180a9598640 (patch)
treeca089414b5e0880de7678d7d06871342310d3247 /player/osd.c
parenta173d3a2fba7c2c3d89af20077dec89ed0424030 (diff)
downloadmpv-a522441bbe6817798ca58b93d7adb180a9598640.tar.bz2
mpv-a522441bbe6817798ca58b93d7adb180a9598640.tar.xz
command: add osd-sym-cc property
This allows you to reproduce the OSD symbol.
Diffstat (limited to 'player/osd.c')
-rw-r--r--player/osd.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/player/osd.c b/player/osd.c
index 08bf28dd85..04b21a22f2 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -443,17 +443,8 @@ void set_osd_subtitle(struct MPContext *mpctx, const char *text)
term_osd_set_subs(mpctx, text);
}
-// sym == mpctx->osd_function
-static void saddf_osd_function_sym(char **buffer, int sym)
+void get_current_osd_sym(struct MPContext *mpctx, char *buf, size_t buf_size)
{
- char temp[10];
- osd_get_function_sym(temp, sizeof(temp), sym);
- saddf(buffer, "%s ", temp);
-}
-
-static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
-{
- bool fractions = mpctx->opts->osd_fractions;
int sym = mpctx->osd_function;
if (!sym) {
if (mpctx->paused_for_cache && !mpctx->opts->pause) {
@@ -464,7 +455,15 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
sym = OSD_PLAY;
}
}
- saddf_osd_function_sym(buffer, sym);
+ osd_get_function_sym(buf, buf_size, sym);
+}
+
+static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
+{
+ bool fractions = mpctx->opts->osd_fractions;
+ char sym[10];
+ get_current_osd_sym(mpctx, sym, sizeof(sym));
+ saddf(buffer, "%s ", sym);
char *custom_msg = mpctx->opts->osd_status_msg;
if (custom_msg && full) {
char *text = mp_property_expand_escaped_string(mpctx, custom_msg);