Commit 7c7ff180 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: mp4: return smallest moov duration as track duration

parent 1a7915a5
...@@ -4134,7 +4134,10 @@ static stime_t GetMoovTrackDuration( demux_sys_t *p_sys, unsigned i_track_ID ) ...@@ -4134,7 +4134,10 @@ static stime_t GetMoovTrackDuration( demux_sys_t *p_sys, unsigned i_track_ID )
/* duration might be wrong an be set to whole duration :/ */ /* duration might be wrong an be set to whole duration :/ */
BOXDATA(p_stsz)->i_sample_count > 0 ) BOXDATA(p_stsz)->i_sample_count > 0 )
{ {
return BOXDATA(p_tkhd)->i_duration; /* In movie / mvhd scale */ if( BOXDATA(p_tkhd)->i_duration <= p_sys->i_moov_duration )
return BOXDATA(p_tkhd)->i_duration; /* In movie / mvhd scale */
else
return p_sys->i_moov_duration;
} }
return 0; return 0;
} }
......
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