]> git.sesse.net Git - vlc/blobdiff - modules/codec/spudec/parse.c
Support for multiple OSD channels :
[vlc] / modules / codec / spudec / parse.c
index 9ffccb387f25ebddc035f747b5e8cd44b2905d7f..bbad591d7b32c1fa0ca63f989a1c4bc84b051d55 100644 (file)
@@ -2,7 +2,7 @@
  * parse.c: SPU parser
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: parse.c,v 1.15 2003/11/22 23:39:14 fenrir Exp $
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -72,7 +72,8 @@ void E_(ParsePacket)( decoder_t *p_dec)
     subpicture_t  *p_spu;
 
     /* Allocate the subpicture internal data. */
-    p_spu = vout_CreateSubPicture( p_sys->p_vout, MEMORY_SUBPICTURE );
+    p_spu = vout_CreateSubPicture( p_sys->p_vout, SUBT1_CHAN, TEXT_CONTENT,
+                                   MEMORY_SUBPICTURE );
     if( p_spu == NULL )
     {
         return;
@@ -225,8 +226,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
         case SPU_CMD_SET_PALETTE:
 
             /* 03xxxx (palette) */
-            if( p_dec->p_fifo->p_demux_data
-                 && *(int*)p_dec->p_fifo->p_demux_data == 0xBeeF )
+            if( p_dec->fmt_in.subs.spu.palette[0] == 0xBeeF )
             {
                 unsigned int idx[4];
 
@@ -239,9 +239,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
 
                 for( i = 0; i < 4 ; i++ )
                 {
-                    uint32_t i_color;
-                    i_color = ((uint32_t*)((char*)p_dec->p_fifo->p_demux_data +
-                                                   sizeof(int)))[idx[i]];
+                    uint32_t i_color = p_dec->fmt_in.subs.spu.palette[1+idx[i]];
 
                     /* FIXME: this job should be done sooner */
                     p_spu->p_sys->pi_yuv[3-i][0] = (i_color>>16) & 0xff;
@@ -286,7 +284,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
                          ((p_sys->buffer[i_index+4]>>4)&0x0f);
             p_spu->i_height = (((p_sys->buffer[i_index+4]&0x0f)<<8)|
                               p_sys->buffer[i_index+5]) - p_spu->i_y + 1;
-
+            
             i_index += 6;
             break;
 
@@ -300,7 +298,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t * p_spu )
             break;
 
         default: /* xx (unknown command) */
-            msg_Err( p_dec, "unknown command 0x%.2x", i_command );
+            msg_Warn( p_dec, "unknown command 0x%.2x", i_command );
             return VLC_EGENERIC;
         }