From 6c3d25e6f5f09a110ad0fffaeeea6a65ee5d228b Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 18 Sep 2014 00:49:55 +0200 Subject: command: allow using ASS tags on OSD messages We don't allow this by default, because it would be silly if random external data (like filenames or file tags) could accidentally trigger them. Add a property that magically disables this ASS tag escaping. Note that malicious input could still disable ASS tag escaping by itself. This would be annoying but harmless. --- player/command.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 8c2856c360..5a523663e8 100644 --- a/player/command.c +++ b/player/command.c @@ -2229,6 +2229,17 @@ static int mp_property_osd_sym(void *ctx, struct m_property *prop, return m_property_strdup_ro(action, arg, temp); } +static int mp_property_osd_ass(void *ctx, struct m_property *prop, + int action, void *arg) +{ + struct m_sub_property props[] = { + {"0", SUB_PROP_STR(osd_ass_0)}, + {"1", SUB_PROP_STR(osd_ass_1)}, + {0} + }; + return m_property_read_sub(props, action, arg); +} + /// Video fps (RO) static int mp_property_fps(void *ctx, struct m_property *prop, int action, void *arg) @@ -2816,6 +2827,7 @@ static const struct m_property mp_properties[] = { {"osd-par", mp_property_osd_par}, {"osd-sym-cc", mp_property_osd_sym}, + {"osd-ass-cc", mp_property_osd_ass}, // Subs {"sid", mp_property_sub}, -- cgit v1.2.3