mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-04-15 04:14:07 +00:00
Fix some new clippy 1.86 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1696>
This commit is contained in:
parent
736afc5ac3
commit
161f2bca0a
3 changed files with 4 additions and 5 deletions
|
@ -880,7 +880,7 @@ impl VideoInfo {
|
|||
#[inline]
|
||||
pub fn field_height(&self) -> u32 {
|
||||
if self.0.interlace_mode == ffi::GST_VIDEO_INTERLACE_MODE_ALTERNATE {
|
||||
(self.0.height as u32 + 1) / 2
|
||||
(self.0.height as u32).div_ceil(2)
|
||||
} else {
|
||||
self.0.height as u32
|
||||
}
|
||||
|
|
|
@ -24,11 +24,10 @@ pub(super) fn line_buffer_len(format: VideoFormat, width: u32) -> usize {
|
|||
skip_assert_initialized!();
|
||||
// Taken from gst-plugins-base/gst-libs/gst/video/video-info.c:fill_planes
|
||||
match format {
|
||||
VideoFormat::V210 => ((width as usize + 47) / 48) * 128,
|
||||
VideoFormat::V210 => (width as usize).div_ceil(48) * 128,
|
||||
VideoFormat::Uyvy => {
|
||||
// round up width to the next multiple of 4
|
||||
// FIXME: {integer}::next_multiple_of was stabilised in rustc 1.73.0
|
||||
((width as usize * 2) + 3) & !3
|
||||
(width as usize * 2).next_multiple_of(4)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
|
|
@ -656,7 +656,7 @@ fn pad_clocktime(f: &mut fmt::Formatter<'_>, sign: Sign, buf: &str) -> fmt::Resu
|
|||
|
||||
// Align center: Split equally between left and right side
|
||||
// If the required padding is odd, the right side gets one more char
|
||||
Alignment::Center => (padding / 2, 0, (padding + 1) / 2),
|
||||
Alignment::Center => (padding / 2, 0, padding.div_ceil(2)),
|
||||
};
|
||||
|
||||
// And now for the actual writing
|
||||
|
|
Loading…
Reference in a new issue