diff options
author | François Laignel <fengalin@free.fr> | 2021-10-09 13:17:05 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2021-10-18 16:09:47 +0300 |
commit | 27b9f0d868f436e9b2bcc3e51f393c40b56fcc02 (patch) | |
tree | 93c0db7b1cf26ea7d0e3a4d70a7d2844c2e00975 /video/gif | |
parent | bd8a7e8df7e8ebf751b2d00fe6a096d726683c00 (diff) |
Improve usability thanks to opt-ops
The crate option-operations simplifies usage when dealing with
`Option`s, which is often the case with `ClockTime`.
Diffstat (limited to 'video/gif')
-rw-r--r-- | video/gif/src/gifenc/imp.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 481c3a590..9c0480274 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -401,9 +401,9 @@ impl VideoEncoderImpl for GifEnc { // is probably less visible than the large stuttering when a complete 10ms have to // "catch up". gif_frame.delay = (frame_delay.mseconds() as f32 / 10.0).round() as u16; - state.gif_pts = state.gif_pts.map(|gif_pts| { - gif_pts + gst::ClockTime::from_mseconds(gif_frame.delay as u64 * 10) - }); + state.gif_pts = state + .gif_pts + .opt_add(gst::ClockTime::from_mseconds(gif_frame.delay as u64 * 10)); // encode new frame let context = state.context.as_mut().unwrap(); |