Commit 7a3abe03 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: libmp4: add tsel atom

parent 8d285ab2
......@@ -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 },
......
......@@ -300,6 +300,7 @@
#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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment