[vlc-commits] demux: libmp4: alias trun
Francois Cartegnie
git at videolan.org
Tue Nov 28 15:33:03 CET 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 28 15:24:04 2017 +0100| [b4f155c52ddc498ce2803cce69e02e6ad95a48cf] | committer: Francois Cartegnie
demux: libmp4: alias trun
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b4f155c52ddc498ce2803cce69e02e6ad95a48cf
---
modules/demux/mp4/libmp4.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 4987588bd3..abc2691eb8 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1110,46 +1110,45 @@ static int MP4_ReadBox_trun( stream_t *p_stream, MP4_Box_t *p_box )
uint32_t count;
MP4_READBOX_ENTER( MP4_Box_data_trun_t, MP4_FreeBox_trun );
-
- MP4_GETVERSIONFLAGS( p_box->data.p_trun );
+ MP4_Box_data_trun_t *p_trun = p_box->data.p_trun;
+ MP4_GETVERSIONFLAGS( p_trun );
MP4_GET4BYTES( count );
- if( p_box->data.p_trun->i_flags & MP4_TRUN_DATA_OFFSET )
- MP4_GET4BYTES( p_box->data.p_trun->i_data_offset );
- if( p_box->data.p_trun->i_flags & MP4_TRUN_FIRST_FLAGS )
- MP4_GET4BYTES( p_box->data.p_trun->i_first_sample_flags );
+ if( p_trun->i_flags & MP4_TRUN_DATA_OFFSET )
+ MP4_GET4BYTES( p_trun->i_data_offset );
+ if( p_trun->i_flags & MP4_TRUN_FIRST_FLAGS )
+ MP4_GET4BYTES( p_trun->i_first_sample_flags );
if( UINT64_C(16) * count > i_read )
MP4_READBOX_EXIT( 0 );
- p_box->data.p_trun->p_samples = vlc_alloc( count,
- sizeof(MP4_descriptor_trun_sample_t) );
- if ( p_box->data.p_trun->p_samples == NULL )
+ p_trun->p_samples = vlc_alloc( count, sizeof(MP4_descriptor_trun_sample_t) );
+ if ( p_trun->p_samples == NULL )
MP4_READBOX_EXIT( 0 );
- p_box->data.p_trun->i_sample_count = count;
+ p_trun->i_sample_count = count;
for( unsigned int i = 0; i < count; i++ )
{
- MP4_descriptor_trun_sample_t *p_sample = &p_box->data.p_trun->p_samples[i];
- if( p_box->data.p_trun->i_flags & MP4_TRUN_SAMPLE_DURATION )
+ MP4_descriptor_trun_sample_t *p_sample = &p_trun->p_samples[i];
+ if( p_trun->i_flags & MP4_TRUN_SAMPLE_DURATION )
MP4_GET4BYTES( p_sample->i_duration );
- if( p_box->data.p_trun->i_flags & MP4_TRUN_SAMPLE_SIZE )
+ if( p_trun->i_flags & MP4_TRUN_SAMPLE_SIZE )
MP4_GET4BYTES( p_sample->i_size );
- if( p_box->data.p_trun->i_flags & MP4_TRUN_SAMPLE_FLAGS )
+ if( p_trun->i_flags & MP4_TRUN_SAMPLE_FLAGS )
MP4_GET4BYTES( p_sample->i_flags );
- if( p_box->data.p_trun->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET )
+ if( p_trun->i_flags & MP4_TRUN_SAMPLE_TIME_OFFSET )
MP4_GET4BYTES( p_sample->i_composition_time_offset.v0 );
}
#ifdef MP4_ULTRA_VERBOSE
msg_Dbg( p_stream, "read box: \"trun\" version %u flags 0x%x sample count %"PRIu32,
- p_box->data.p_trun->i_version,
- p_box->data.p_trun->i_flags,
- p_box->data.p_trun->i_sample_count );
+ p_trun->i_version,
+ p_trun->i_flags,
+ p_trun->i_sample_count );
for( unsigned int i = 0; i < count; i++ )
{
- MP4_descriptor_trun_sample_t *p_sample = &p_box->data.p_trun->p_samples[i];
+ MP4_descriptor_trun_sample_t *p_sample = &p_trun->p_samples[i];
msg_Dbg( p_stream, "read box: \"trun\" sample %4.4u flags 0x%x "\
"duration %"PRIu32" size %"PRIu32" composition time offset %"PRIu32,
i, p_sample->i_flags, p_sample->i_duration,
More information about the vlc-commits
mailing list