[vlc-commits] demux: mp4: handle ttml

Francois Cartegnie git at videolan.org
Mon Jan 23 10:27:37 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 17 18:38:16 2017 +0100| [32272afceea488d49b9b27d994facbd59ee99d08] | committer: Francois Cartegnie

demux: mp4: handle ttml

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

 modules/demux/mp4/essetup.c | 4 ++++
 modules/demux/mp4/libmp4.h  | 1 +
 modules/demux/mp4/mp4.c     | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 7482e28..2647972 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -1174,6 +1174,10 @@ int SetupSpuES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
     /* It's a little ugly but .. there are special cases */
     switch( p_sample->i_type )
     {
+        case VLC_FOURCC('s','t','p','p'):
+            p_track->fmt.i_codec = VLC_CODEC_TTML;
+            break;
+
         case ATOM_c608: /* EIA608 closed captions */
         //case ATOM_c708: /* EIA708 closed captions */
             p_track->fmt.i_codec = VLC_CODEC_EIA608_1;
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 726a790..b513e01 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -283,6 +283,7 @@ typedef int64_t stime_t;
 #define ATOM_text VLC_FOURCC( 't', 'e', 'x', 't' )
 #define ATOM_tx3g VLC_FOURCC( 't', 'x', '3', 'g' )
 #define ATOM_subp VLC_FOURCC( 's', 'u', 'b', 'p' )
+#define ATOM_subt VLC_FOURCC( 's', 'u', 'b', 't' )
 #define ATOM_sbtl VLC_FOURCC( 's', 'b', 't', 'l' )
 #define ATOM_clcp VLC_FOURCC( 'c', 'l', 'c', 'p' )
 #define ATOM_c608 VLC_FOURCC( 'c', '6', '0', '8' )
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index c37483b..54084a9 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -519,6 +519,7 @@ static block_t * MP4_Block_Convert( demux_t *p_demux, const mp4_track_t *p_track
     {
         switch( p_track->fmt.i_codec )
         {
+            case VLC_CODEC_TTML:
             case VLC_CODEC_TX3G:
             case VLC_CODEC_SPU:
             /* accept as-is */
@@ -3098,6 +3099,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
         case( ATOM_tx3g ):
         case( ATOM_text ):
         case( ATOM_subp ):
+        case( ATOM_subt ): /* ttml */
         case( ATOM_sbtl ):
         case( ATOM_clcp ): /* closed captions */
             p_track->fmt.i_cat = SPU_ES;



More information about the vlc-commits mailing list