mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 21:11:00 +00:00
mp4mux: Make use of i64::TryFrom<gst::Signed<u64>>
impl
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/979>
This commit is contained in:
parent
9903d536b5
commit
3003987c3a
1 changed files with 4 additions and 12 deletions
|
@ -594,18 +594,10 @@ impl MP4Mux {
|
|||
let pts = gst::Signed::Positive(pts);
|
||||
let dts = dts.unwrap(); // set above
|
||||
|
||||
if pts > dts {
|
||||
Some(i64::try_from((pts - dts).nseconds().positive().unwrap()).map_err(|_| {
|
||||
Some(i64::try_from((pts - dts).nseconds()).map_err(|_| {
|
||||
gst::error!(CAT, obj: stream.sinkpad, "Too big PTS/DTS difference");
|
||||
gst::FlowError::Error
|
||||
})?)
|
||||
} else {
|
||||
let diff = i64::try_from((dts - pts).nseconds().positive().unwrap()).map_err(|_| {
|
||||
gst::error!(CAT, obj: stream.sinkpad, "Too big PTS/DTS difference");
|
||||
gst::FlowError::Error
|
||||
})?;
|
||||
Some(-diff)
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue