summaryrefslogtreecommitdiffstats
path: root/player/osd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-02-20 14:46:23 +0100
committerwm4 <wm4@nowhere>2014-02-20 14:46:23 +0100
commit98dc8206ae61a857db6017e7244a9af0e578adc6 (patch)
treeb3a5028a0f75bfa187089e7048f897cb42c7cb50 /player/osd.c
parent857952dce3e78e678bf6d14046e2290e7016d6b8 (diff)
downloadmpv-98dc8206ae61a857db6017e7244a9af0e578adc6.tar.bz2
mpv-98dc8206ae61a857db6017e7244a9af0e578adc6.tar.xz
options: handle escape sequences in e.g. --playing-msg differently
M_OPT_PARSE_ESCAPES was pretty stupid, and broke the (useful) assumption that string variables contain exactly the same value as set by the option. Simplify it, and move escape handling to the place where it's used. Escape handling itself is not terribly useful, but still allows useful things like multiline custom OSD with "\n".
Diffstat (limited to 'player/osd.c')
-rw-r--r--player/osd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/osd.c b/player/osd.c
index abfe826a81..d8ba356b33 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -159,7 +159,7 @@ void print_status(struct MPContext *mpctx)
}
if (opts->status_msg) {
- char *r = mp_property_expand_string(mpctx, opts->status_msg);
+ char *r = mp_property_expand_escaped_string(mpctx, opts->status_msg);
term_osd_set_status(mpctx, r);
talloc_free(r);
return;
@@ -428,7 +428,7 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
saddf_osd_function_sym(buffer, sym);
char *custom_msg = mpctx->opts->osd_status_msg;
if (custom_msg && full) {
- char *text = mp_property_expand_string(mpctx, custom_msg);
+ char *text = mp_property_expand_escaped_string(mpctx, custom_msg);
*buffer = talloc_strdup_append(*buffer, text);
talloc_free(text);
} else {