]> git.sesse.net Git - vlc/commitdiff
* ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix
authorSam Hocevar <sam@videolan.org>
Tue, 23 Apr 2002 20:58:24 +0000 (20:58 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 23 Apr 2002 20:58:24 +0000 (20:58 +0000)
    to avoid retrieving the spu palette from a network stream as if it was
    a DVD.

ChangeLog
plugins/dvd/dvd_es.c
plugins/spudec/spu_decoder.c

index 7f2f92172d0a76d6c10f98bfe591de60c4001071..800712a8937c844b9c67b9a0aec99eaa3ff24769 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
 
 HEAD
 
+  * ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix
+    to avoid retrieving the spu palette from a network stream as if it was
+    a DVD.
   * ./src/interface/main.c: tidied the help output code.
   * ALL: removed underscores from option names and made a few options more
     self-explanatory, for instance --input_channel becomes --audio-channel;
index c708558a6797302de9bfc3f47b93e1f98028656f..e9a6d8255fcbae81a6e3283668c4cfe15d0f6bd8 100644 (file)
@@ -1,7 +1,7 @@
 /* dvd_es.c: functions to find and select ES
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_es.c,v 1.7 2002/04/23 14:16:20 sam Exp $
+ * $Id: dvd_es.c,v 1.8 2002/04/23 20:58:23 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -231,8 +231,10 @@ void DVDReadSPU( input_thread_t * p_input )
             {
                 ADDES( 0xbd, 0x20 + i_id, DVD_SPU_ES, SPU_ES,
                        vts.manager_inf.p_spu_attr[i-1].i_lang_code,
-                       16*sizeof(u32) );
-                memcpy( p_es->p_demux_data, palette, 16*sizeof(u32) ); 
+                       sizeof(int) + 16*sizeof(u32) );
+                *(int*)p_es->p_demux_data = 0xBeeF;
+                memcpy( (void*)p_es->p_demux_data + sizeof(int),
+                        palette, 16*sizeof(u32) ); 
             }
             else
             {
index 967c257229af993d4a3c65d525ca055d67244f69..8ec9c1956d391c78a1993a6d5eb667bf7859bb08 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.15 2002/04/18 12:51:59 sam Exp $
+ * $Id: spu_decoder.c,v 1.16 2002/04/23 20:58:23 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -426,13 +426,15 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
                 case SPU_CMD_SET_PALETTE:
  
                     /* 03xxxx (palette) */
-                    if( p_spudec->p_config->p_demux_data )
+                    if( p_spudec->p_config->p_demux_data &&
+                         *(int*)p_spudec->p_config->p_demux_data == 0xBeeF )
                     {
                         p_spu->p_sys->b_palette = 1;
                         for( i = 0; i < 4 ; i++ )
                         {
-                            pi_color = (u8*)p_spudec->p_config->p_demux_data
-                                    + 4 * GetBits( &p_spudec->bit_stream, 4 );
+                            pi_color = (void*)p_spudec->p_config->p_demux_data
+                                         + sizeof(int) + 4 * sizeof(u8) *
+                                          GetBits( &p_spudec->bit_stream, 4 );
                             p_spu->p_sys->pi_yuv[3-i][0] = pi_color[2];
                             p_spu->p_sys->pi_yuv[3-i][1] = pi_color[0];
                             p_spu->p_sys->pi_yuv[3-i][2] = pi_color[1];