[vlc-commits] vlc_es: use a common define for the initialized SPU palette

Steve Lhomme git at videolan.org
Sat Jul 8 18:39:12 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Jul  6 14:49:59 2017 +0200| [b7b77018e998abb71255495608e05b778a4b9b4a] | committer: Jean-Baptiste Kempf

vlc_es: use a common define for the initialized SPU palette

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b7b77018e998abb71255495608e05b778a4b9b4a
---

 include/vlc_es.h                             | 2 ++
 modules/access/dvdnav.c                      | 2 +-
 modules/access/dvdread.c                     | 2 +-
 modules/codec/spudec/parse.c                 | 2 +-
 modules/demux/avformat/demux.c               | 2 +-
 modules/demux/mkv/matroska_segment_parse.cpp | 2 +-
 modules/demux/mp4/essetup.c                  | 2 +-
 modules/demux/vobsub.c                       | 2 +-
 8 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index d469c376f7..52d4d0cdcd 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -534,6 +534,8 @@ struct subs_format_t
     text_style_t *p_style; /* Default styles to use */
 };
 
+#define SPU_PALETTE_DEFINED  0xbeefbeef
+
 /**
  * ES language definition
  */
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index ada8713904..0c7fec8a07 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1503,7 +1503,7 @@ static void ESNew( demux_t *p_demux, int i_id )
         }
 
         /* Palette */
-        tk->fmt.subs.spu.palette[0] = 0xBeef;
+        tk->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
         memcpy( &tk->fmt.subs.spu.palette[1], p_sys->clut,
                 16 * sizeof( uint32_t ) );
 
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index b479b9eeee..747e511475 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -706,7 +706,7 @@ static void ESNew( demux_t *p_demux, int i_id, int i_lang )
     else if( tk->fmt.i_cat == SPU_ES )
     {
         /* Palette */
-        tk->fmt.subs.spu.palette[0] = 0xBeef;
+        tk->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
         memcpy( &tk->fmt.subs.spu.palette[1], p_sys->clut,
                 16 * sizeof( uint32_t ) );
 
diff --git a/modules/codec/spudec/parse.c b/modules/codec/spudec/parse.c
index 0db3b4deb7..c4e8bc0794 100644
--- a/modules/codec/spudec/parse.c
+++ b/modules/codec/spudec/parse.c
@@ -264,7 +264,7 @@ static int ParseControlSeq( decoder_t *p_dec, subpicture_t *p_spu,
                 return VLC_EGENERIC;
             }
 
-            if( p_dec->fmt_in.subs.spu.palette[0] == 0xBeeF )
+            if( p_dec->fmt_in.subs.spu.palette[0] == SPU_PALETTE_DEFINED )
             {
                 unsigned int idx[4];
                 int i;
diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index e5275c30ec..c2489c6eed 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -486,7 +486,7 @@ int OpenDemux( vlc_object_t *p_this )
                     if( psz_start &&
                         vobsub_palette_parse( psz_start, &es_fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
                     {
-                        es_fmt.subs.spu.palette[0] =  0xBeef;
+                        es_fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
                         msg_Dbg( p_demux, "vobsub palette read" );
                     }
                     else
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index ef9f45cdc9..594e83ac28 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1890,7 +1890,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
                     if( psz_start &&
                         vobsub_palette_parse( psz_start, &p_tk->fmt.subs.spu.palette[1] ) == VLC_SUCCESS )
                     {
-                        p_tk->fmt.subs.spu.palette[0] =  0xBeef;
+                        p_tk->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
                         msg_Dbg( vars.p_demuxer, "vobsub palette read" );
                     }
                     else
diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index cc53143881..bf3232486b 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -167,7 +167,7 @@ static void SetupESDS( demux_t *p_demux, mp4_track_t *p_track, const MP4_descrip
             p_track->fmt.subs.spu.palette[1 + i] =
                     GetDWBE((char*)p_track->fmt.p_extra + i * 4);
         }
-        p_track->fmt.subs.spu.palette[0] = 0xBeef;
+        p_track->fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
     }
 }
 
diff --git a/modules/demux/vobsub.c b/modules/demux/vobsub.c
index a04b854551..d46775b5b5 100644
--- a/modules/demux/vobsub.c
+++ b/modules/demux/vobsub.c
@@ -558,7 +558,7 @@ static int ParseVobSubIDX( demux_t *p_demux )
             fmt.psz_language = language;
             if( p_sys->b_palette )
             {
-                fmt.subs.spu.palette[0] = 0xBeef;
+                fmt.subs.spu.palette[0] = SPU_PALETTE_DEFINED;
                 memcpy( &fmt.subs.spu.palette[1], p_sys->palette, 16 * sizeof( uint32_t ) );
             }
 



More information about the vlc-commits mailing list