changeset 25844:6b01c546c5c3

Support vobsub palette in extradata, as exported by libavformat
author reimar
date Sat, 26 Jan 2008 23:47:25 +0000
parents 245e2ffbb2d5
children ae814d807d40
files mplayer.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sat Jan 26 22:25:47 2008 +0000
+++ b/mplayer.c	Sat Jan 26 23:47:25 2008 +0000
@@ -49,6 +49,8 @@
 
 #include "cfg-mplayer-def.h"
 
+#include "libavutil/intreadwrite.h"
+
 #include "subreader.h"
 
 #include "libvo/video_out.h"
@@ -1119,6 +1121,12 @@
   if (vo_spudec==NULL) {
     sh_sub_t *sh = (sh_sub_t *)mpctx->d_sub->sh;
     unsigned int *palette = NULL;
+    if (sh && !sh->has_palette && sh->extradata_len == 16*4) {
+      int i;
+      for (i = 0; i < 16; i++)
+        sh->palette[i] = AV_RB32(sh->extradata + i*4);
+      sh->has_palette = 1;
+    }
     if (sh && sh->has_palette)
       palette = sh->palette;
     current_module="spudec_init_normal";