Commit 3ff38b86 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: mp4: fix TRUN composition time signedness

parent 105797f1
...@@ -953,7 +953,7 @@ typedef struct MP4_descriptor_trun_sample_t ...@@ -953,7 +953,7 @@ typedef struct MP4_descriptor_trun_sample_t
uint32_t i_duration; uint32_t i_duration;
uint32_t i_size; uint32_t i_size;
uint32_t i_flags; uint32_t i_flags;
uint32_t i_composition_time_offset; uint32_t i_composition_time_offset; /* version == 0 ? signed : unsigned */
} MP4_descriptor_trun_sample_t; } MP4_descriptor_trun_sample_t;
typedef struct MP4_Box_data_trun_s typedef struct MP4_Box_data_trun_s
......
...@@ -3933,8 +3933,10 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t ...@@ -3933,8 +3933,10 @@ static int MP4_frg_GetChunk( demux_t *p_demux, MP4_Box_t *p_chunk, unsigned *i_t
if( ret->p_sample_offset_pts ) if( ret->p_sample_offset_pts )
{ {
ret->p_sample_offset_pts[i] = if ( p_trun_data->i_version == 0 )
p_trun_data->p_samples[i].i_composition_time_offset; ret->p_sample_offset_pts[i] = (int32_t) p_trun_data->p_samples[i].i_composition_time_offset;
else
ret->p_sample_offset_pts[i] = __MIN( INT32_MAX, p_trun_data->p_samples[i].i_composition_time_offset );
} }
if( p_trun_data->i_flags & MP4_TRUN_SAMPLE_SIZE ) if( p_trun_data->i_flags & MP4_TRUN_SAMPLE_SIZE )
......
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