From 4a901e4db0f9c71e70a16c40d5dd1dba04732583 Mon Sep 17 00:00:00 2001 From: ulion Date: Wed, 19 Dec 2007 08:35:40 +0000 Subject: Vobsub support tridx setting in .idx file. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25460 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mkv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libmpdemux/demux_mkv.c') diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index 2f9424c9d8..e7307156ca 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -344,6 +344,8 @@ static int vobsub_parse_custom_colors (sh_sub_t *sh, const char *start) { int use_custom_colors, i; + const char *p; + unsigned int tridx = 0; use_custom_colors = 0; start += 14; @@ -355,6 +357,8 @@ vobsub_parse_custom_colors (sh_sub_t *sh, const char *start) use_custom_colors = 0; mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] VobSub custom colors: %s\n", use_custom_colors ? "ON" : "OFF"); + if ((p = strstr(start, "tridx:")) != NULL) + tridx = strtoul(p + 6, NULL, 2); if ((start = strstr(start, "colors:")) != NULL) { start += 7; @@ -366,6 +370,8 @@ vobsub_parse_custom_colors (sh_sub_t *sh, const char *start) if (sscanf(start, "%06x", &tmp) != 1) break; sh->colors[i] = vobsub_rgb_to_yuv(tmp); + if ((tridx << i) & 0x08) + sh->colors[i] |= 1 << 31; start += 6; while ((*start == ',') || isspace(*start)) start++; @@ -373,8 +379,8 @@ vobsub_parse_custom_colors (sh_sub_t *sh, const char *start) if (i == 4) { sh->custom_colors = 4; - mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] VobSub colors: %06x," - "%06x,%06x,%06x\n", sh->colors[0], + mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] VobSub colors: %08x," + "%08x,%08x,%08x\n", sh->colors[0], sh->colors[1], sh->colors[2], sh->colors[3]); } -- cgit v1.2.3