From 6df4adac31a199adeeaeb50ea3ad595de4baaa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 2 May 2025 19:05:23 +0300 Subject: [PATCH] fmp4mux: Use earliest PTS for the base media decode time (tfdt) While this is supposed to be a decode time, this doesn't really match the description in the specification. It starts at 0 and increases by the duration of each fragment, i.e. is the sum of all previous sample durations. Part-of: --- mux/fmp4/src/fmp4mux/imp.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index dc3cbea7c..67e132c3f 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -2452,8 +2452,6 @@ impl FMP4Mux { Option, // End DTS Option, - // Start time (either matches start_dts if required or earliest-pts) - gst::ClockTime, // Start NTP time (either matches start_dts if required or earliest_pts) Option, )>, @@ -2585,12 +2583,6 @@ impl FMP4Mux { let start_dts = start_dts; let start_dts_position = start_dts_position; - let start_time = if !stream.delta_frames.requires_dts() { - earliest_pts - } else { - start_dts.unwrap() - }; - Ok(Some(( buffers, earliest_pts, @@ -2599,7 +2591,6 @@ impl FMP4Mux { start_dts, start_dts_position, end_dts, - start_time, start_ntp_time, ))) } @@ -2839,7 +2830,6 @@ impl FMP4Mux { start_dts, start_dts_position, _end_dts, - start_time, start_ntp_time, ) = match buffers { Some(res) => res, @@ -2892,7 +2882,7 @@ impl FMP4Mux { drained_streams.push(( super::FragmentHeaderStream { caps: stream.caps.clone(), - start_time: Some(start_time), + start_time: Some(earliest_pts), start_ntp_time, delta_frames: stream.delta_frames, trak_timescale,