Commit a5cf9514 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

MP4: fix trkn parsing and support totaltrack

parent 5196f9e5
...@@ -1461,13 +1461,14 @@ static int MP4_ReadBox_trkn( stream_t *p_stream, MP4_Box_t *p_box ) ...@@ -1461,13 +1461,14 @@ static int MP4_ReadBox_trkn( stream_t *p_stream, MP4_Box_t *p_box )
uint32_t i_reserved; uint32_t i_reserved;
MP4_GET4BYTES( i_version ); MP4_GET4BYTES( i_version );
MP4_GET4BYTES( i_reserved ); MP4_GET4BYTES( i_reserved );
MP4_GET4BYTES( p_trkn->i_track_number ); MP4_GET2BYTES( i_reserved );
MP4_GET2BYTES( p_trkn->i_track_number );
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream, "read box: \"trkn\" number=%i", p_trkn->i_track_number ); msg_Dbg( p_stream, "read box: \"trkn\" number=%i", p_trkn->i_track_number );
#endif #endif
if( i_data_len > 15 ) if( i_data_len > 15 )
{ {
MP4_GET4BYTES( p_trkn->i_track_total ); MP4_GET2BYTES( p_trkn->i_track_total );
#ifdef MP4_VERBOSE #ifdef MP4_VERBOSE
msg_Dbg( p_stream, "read box: \"trkn\" total=%i", p_trkn->i_track_total ); msg_Dbg( p_stream, "read box: \"trkn\" total=%i", p_trkn->i_track_total );
#endif #endif
......
...@@ -843,6 +843,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -843,6 +843,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
snprintf( psz_trck, sizeof( psz_trck ), "%i", snprintf( psz_trck, sizeof( psz_trck ), "%i",
p_0xa9xxx->data.p_trkn->i_track_number ); p_0xa9xxx->data.p_trkn->i_track_number );
vlc_meta_SetTrackNum( p_meta, psz_trck ); vlc_meta_SetTrackNum( p_meta, psz_trck );
snprintf( psz_trck, sizeof( psz_trck ), "%i",
p_0xa9xxx->data.p_trkn->i_track_total );
vlc_meta_Set( p_meta, vlc_meta_TrackTotal, psz_trck );
break; break;
} }
case ATOM_0xa9cmt: /* Commment */ case ATOM_0xa9cmt: /* Commment */
......
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