[vlc-devel] [PATCH] mp4: unbreak vobsub playback and read vobsub palette

John Stebbins stebbins at jetheaddev.com
Sun Apr 6 21:54:56 CEST 2014


---
 modules/demux/mp4/mp4.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 265c7c5..ac22e1d 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -757,7 +757,8 @@ static int Demux( demux_t *p_demux )
                 }
                 else if( tk->fmt.i_cat == SPU_ES )
                 {
-                    if ( tk->fmt.i_codec != VLC_CODEC_TX3G )
+                    if ( tk->fmt.i_codec != VLC_CODEC_TX3G &&
+                         tk->fmt.i_codec != VLC_CODEC_SPU )
                         p_block->i_buffer = 0;
                 }
 
@@ -2211,6 +2212,16 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
             memcpy( p_track->fmt.p_extra, p_decconfig->p_decoder_specific_info,
                     p_track->fmt.i_extra );
         }
+        if( p_track->fmt.i_codec == VLC_CODEC_SPU &&
+            p_track->fmt.i_extra >= 16 * 4 )
+        {
+            for( int i = 0; i < 16; i++ )
+            {
+                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;
+        }
     }
     else
     {
-- 
1.9.0




More information about the vlc-devel mailing list