diff options
author | François Laignel <fengalin@free.fr> | 2020-10-19 18:03:10 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2020-10-21 00:45:01 +0300 |
commit | 7c3e69bb4aba6e3a5da95e3c610b85d5b629fb72 (patch) | |
tree | 47bfcd0c119d68c7c23bf36cb03bf4e0d11d8244 /video/flavors | |
parent | bbc18d6349aaaabd9ae43a08c3874718a929e12b (diff) |
Fix ClockTime comparisons not being Ord and use saturating_sub
See:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/607
Diffstat (limited to 'video/flavors')
-rw-r--r-- | video/flavors/src/flvdemux.rs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/video/flavors/src/flvdemux.rs b/video/flavors/src/flvdemux.rs index 5bb69c42b..7908cf11d 100644 --- a/video/flavors/src/flvdemux.rs +++ b/video/flavors/src/flvdemux.rs @@ -1193,18 +1193,12 @@ impl StreamingState { } fn update_position(&mut self, buffer: &gst::Buffer) { - if buffer.get_pts() != gst::CLOCK_TIME_NONE { + if buffer.get_pts().is_some() { let pts = buffer.get_pts(); - self.last_position = self - .last_position - .map(|last| cmp::max(last.into(), pts)) - .unwrap_or(pts); - } else if buffer.get_dts() != gst::CLOCK_TIME_NONE { + self.last_position = self.last_position.max(pts).unwrap_or(pts); + } else if buffer.get_dts().is_some() { let dts = buffer.get_dts(); - self.last_position = self - .last_position - .map(|last| cmp::max(last.into(), dts)) - .unwrap_or(dts); + self.last_position = self.last_position.max(dts).unwrap_or(dts); } } } |