mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-08 18:25:30 +00:00
fmp4mux: Don't overflow negative composition offset calculation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1338>
This commit is contained in:
parent
1d52139e35
commit
32a730f6fa
1 changed files with 7 additions and 1 deletions
|
@ -1741,7 +1741,13 @@ impl FMP4Mux {
|
|||
let pts = buffer.pts;
|
||||
let dts = buffer.dts.unwrap();
|
||||
|
||||
Some(i64::try_from((pts - dts).nseconds()).map_err(|_| {
|
||||
let diff = if pts > dts {
|
||||
i64::try_from(pts.nseconds() - dts.nseconds())
|
||||
} else {
|
||||
i64::try_from(dts.nseconds() - pts.nseconds()).map(|x| -x)
|
||||
};
|
||||
|
||||
Some(diff.map_err(|_| {
|
||||
gst::error!(CAT, obj: stream.sinkpad, "Too big PTS/DTS difference");
|
||||
gst::FlowError::Error
|
||||
})?)
|
||||
|
|
Loading…
Reference in a new issue