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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2223>
This commit is contained in:
Sebastian Dröge 2025-05-02 19:05:23 +03:00
parent 3012dac758
commit 6df4adac31

View file

@ -2452,8 +2452,6 @@ impl FMP4Mux {
Option<gst::ClockTime>,
// End DTS
Option<gst::ClockTime>,
// 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<gst::ClockTime>,
)>,
@ -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,