]> git.sesse.net Git - vlc/commitdiff
demux: libmp4: add tsel atom
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 17 Oct 2014 19:53:10 +0000 (21:53 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 17 Oct 2014 22:42:15 +0000 (00:42 +0200)
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.h

index 53f4a32426e3b485b50cf387d65bcced3a87dbd5..3ace93e72a4a4d07cc2d18a3ff514fd6afcf46d6 100644 (file)
@@ -3276,6 +3276,18 @@ static void MP4_FreeBox_sdtp( MP4_Box_t *p_box )
     FREENULL( p_box->data.p_sdtp->p_sample_table );
 }
 
+static int MP4_ReadBox_tsel( stream_t *p_stream, MP4_Box_t *p_box )
+{
+    MP4_READBOX_ENTER( MP4_Box_data_tsel_t );
+    uint32_t i_version;
+    MP4_GET4BYTES( i_version );
+    if ( i_version != 0 || i_read < 4 )
+        MP4_READBOX_EXIT( 0 );
+    MP4_GET4BYTES( p_box->data.p_tsel->i_switch_group );
+    /* ignore list of attributes as es are present before switch */
+    MP4_READBOX_EXIT( 1 );
+}
+
 static int MP4_ReadBox_mfro( stream_t *p_stream, MP4_Box_t *p_box )
 {
     MP4_READBOX_ENTER( MP4_Box_data_mfro_t );
@@ -3779,6 +3791,9 @@ static const struct
     { ATOM_vndr,    MP4_ReadBox_String,       MP4_FreeBox_String,  ATOM_udta },
     { ATOM_SDLN,    MP4_ReadBox_String,       MP4_FreeBox_String,  ATOM_udta },
 
+    /* udta, non meta */
+    { ATOM_tsel,    MP4_ReadBox_tsel,         MP4_FreeBox_Common,  ATOM_udta },
+
     /* iTunes/Quicktime meta info */
     { ATOM_meta,    MP4_ReadBox_meta,         MP4_FreeBox_Common,  0 },
     { ATOM_data,    MP4_ReadBox_data,         MP4_FreeBox_data,    0 },
index 6abfc2975f6634891f847d2a078cbe5dbe15672c..f1c5d70e5bb2008462f31e579717bfff8a764c10 100644 (file)
 #define ATOM_covr VLC_FOURCC( 'c', 'o', 'v', 'r' )
 #define ATOM_flvr VLC_FOURCC( 'f', 'l', 'v', 'r' )
 #define ATOM_rtng VLC_FOURCC( 'r', 't', 'n', 'g' )
+#define ATOM_tsel VLC_FOURCC( 't', 's', 'e', 'l' )
 #define ATOM_xid_ VLC_FOURCC( 'x', 'i', 'd', ' ' )
 
 #define ATOM_chap VLC_FOURCC( 'c', 'h', 'a', 'p' )
@@ -1264,6 +1265,11 @@ typedef struct
     uint8_t *p_sample_table;
 } MP4_Box_data_sdtp_t;
 
+typedef struct
+{
+    uint32_t i_switch_group;
+} MP4_Box_data_tsel_t;
+
 typedef struct
 {
     uint8_t  i_version;
@@ -1393,6 +1399,7 @@ typedef union MP4_Box_data_s
     MP4_Box_data_trex_t *p_trex;
     MP4_Box_data_mehd_t *p_mehd;
     MP4_Box_data_sdtp_t *p_sdtp;
+    MP4_Box_data_tsel_t *p_tsel;
 
     MP4_Box_data_tfra_t *p_tfra;
     MP4_Box_data_mfro_t *p_mfro;