diff libmpdemux/demux_mkv.c @ 25432:7957b8762195

Vobsub support tridx setting in .idx file.
author ulion
date Wed, 19 Dec 2007 08:35:40 +0000
parents fb719ee583b5
children 3d5fb36693ac
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Wed Dec 19 04:45:45 2007 +0000
+++ b/libmpdemux/demux_mkv.c	Wed Dec 19 08:35:40 2007 +0000
@@ -344,6 +344,8 @@
 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 @@
      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 @@
            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 @@
        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]);
          }