[vlc-commits] demux: mp4: unbreak vobsub playback and read vobsub palette

John Stebbins git at videolan.org
Sun Apr 13 19:40:08 CEST 2014


vlc | branch: master | John Stebbins <stebbins at jetheaddev.com> | Wed Apr  9 12:45:38 2014 -0600| [d87dbcb0c9e47acb02d20cfe71009702d57af1a9] | committer: Francois Cartegnie

demux: mp4: unbreak vobsub playback and read vobsub palette

Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

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

 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 ec43931..0adb8d9 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -758,7 +758,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;
                 }
 
@@ -2315,6 +2316,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
     {



More information about the vlc-commits mailing list