[vlc-commits] demux: mp4: simplify spu setup

Francois Cartegnie git at videolan.org
Tue Jan 17 20:14:57 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 17 15:34:05 2017 +0100| [c538c770c2af27852182ae56e371d1a3176a9ce5] | committer: Francois Cartegnie

demux: mp4: simplify spu setup

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

 modules/demux/mp4/essetup.c | 29 ++++++++---------------------
 modules/demux/mp4/mp4.c     | 13 +++----------
 2 files changed, 11 insertions(+), 31 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index c06d475..ac1d8c5 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -1167,36 +1167,23 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
     return 1;
 }
 
-int SetupCCES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
+int SetupSpuES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
 {
-    VLC_UNUSED(p_demux);
-
+    /* It's a little ugly but .. there are special cases */
     switch( p_sample->i_type )
     {
-        case( ATOM_c608 ): /* EIA608 closed captions */
-        //case( ATOM_c708 ): /* EIA708 closed captions */
+        case ATOM_c608: /* EIA608 closed captions */
+        //case ATOM_c708: /* EIA708 closed captions */
             p_track->fmt.i_codec = VLC_CODEC_EIA608_1;
-            p_track->fmt.i_cat = SPU_ES;
             break;
-        default:
-            return 0;
-    }
-
-    return 1;
-}
 
-int SetupSpuES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
-{
-    MP4_Box_data_sample_text_t *p_text = p_sample->data.p_sample_text;
-    if(!p_text)
-        return 0;
-
-    /* It's a little ugly but .. there are special cases */
-    switch( p_sample->i_type )
-    {
         case( VLC_FOURCC( 't', 'e', 'x', 't' ) ):
         case( VLC_FOURCC( 't', 'x', '3', 'g' ) ):
         {
+            const MP4_Box_data_sample_text_t *p_text = p_sample->data.p_sample_text;
+            if(!p_text)
+                return 0;
+
             p_track->fmt.i_codec = VLC_CODEC_TX3G;
 
             if( p_text->i_display_flags & 0xC0000000 )
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 898c2fd..badcd6b 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -2652,16 +2652,9 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
         break;
 
     case SPU_ES:
-        switch( p_sample->i_handler )
-        {
-            case ATOM_clcp:
-                if ( !SetupCCES( p_demux, p_track, p_sample ) )
-                    return VLC_EGENERIC;
-                break;
-            default:
-                if ( !SetupSpuES( p_demux, p_track, p_sample ) )
-                 return VLC_EGENERIC;
-        }
+        if ( !SetupSpuES( p_demux, p_track, p_sample ) )
+           return VLC_EGENERIC;
+        break;
 
     default:
         break;



More information about the vlc-commits mailing list