changeset 25845:ae814d807d40

Simplify init_vobsub: pass palette via extradata.
author reimar
date Sat, 26 Jan 2008 23:52:15 +0000
parents 6b01c546c5c3
children f3ae700cc317
files libmpdemux/demux_mov.c
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mov.c	Sat Jan 26 23:47:25 2008 +0000
+++ b/libmpdemux/demux_mov.c	Sat Jan 26 23:52:15 2008 +0000
@@ -564,17 +564,12 @@
 }
 
 static void init_vobsub(sh_sub_t *sh, mov_track_t *trak) {
-  int i;
-  uint8_t *pal = trak->stdata;
   sh->type = 'v';
   if (trak->stdata_len < 106)
     return;
-  sh->has_palette = 1;
-  pal += 42;
-  for (i = 0; i < 16; i++) {
-    sh->palette[i] = BE_32(pal);
-    pal += 4;
-  }
+  sh->extradata_len = 16*4;
+  sh->extradata = malloc(sh->extradata_len);
+  memcpy(sh->extradata, trak->stdata + 42, sh->extradata_len);
 }
 
 static int lschunks_intrak(demuxer_t* demuxer, int level, unsigned int id,