mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-22 10:06:29 +00:00
mp4mux: Fix edit list shift for streams with initial DTS smaller earliest PTS but initial DTS positive
This would be a stream where the initial DTS is negative if the initial PTS was zero, but it is offset so the initial DTS became positive now. The edit list shift has to happen exactly the same way though. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1014>
This commit is contained in:
parent
ed429d570e
commit
9307acf7fa
1 changed files with 4 additions and 2 deletions
|
@ -1683,9 +1683,11 @@ fn write_elst(
|
||||||
v.extend(duration.to_be_bytes());
|
v.extend(duration.to_be_bytes());
|
||||||
|
|
||||||
// Media time
|
// Media time
|
||||||
if let Some(gst::Signed::Negative(start_dts)) = stream.start_dts {
|
if let Some(start_dts) = stream.start_dts {
|
||||||
let shift = (stream.earliest_pts + start_dts)
|
let shift = (gst::Signed::Positive(stream.earliest_pts) - start_dts)
|
||||||
.nseconds()
|
.nseconds()
|
||||||
|
.positive()
|
||||||
|
.unwrap_or(0)
|
||||||
.mul_div_round(timescale as u64, gst::ClockTime::SECOND.nseconds())
|
.mul_div_round(timescale as u64, gst::ClockTime::SECOND.nseconds())
|
||||||
.context("too big track duration")?;
|
.context("too big track duration")?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue