Commit 6ac9e171 authored by Yusuke Nakamura's avatar Yusuke Nakamura Committed by Fiona Glaser

Fix slightly wrong mp4 duration.

parent ddfe4124
......@@ -122,7 +122,7 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
* So, if mdhd duration is equal to the last DTS or less, we give the last composition time delta to the last sample duration.
* And then, the mdhd duration is updated, but it time-wise doesn't give the actual duration.
* The tkhd duration is the actual track duration. */
uint64_t mdhd_duration = (2 * largest_pts - second_largest_pts - p_mp4->i_delay_time) * p_mp4->i_time_inc;
uint64_t mdhd_duration = (2 * largest_pts - second_largest_pts) * p_mp4->i_time_inc;
if( mdhd_duration != gf_isom_get_media_duration( p_mp4->p_file, p_mp4->i_track ) )
uint64_t last_dts = gf_isom_get_sample_dts( p_mp4->p_file, p_mp4->i_track, p_mp4->i_numframe );
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