Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikWin committed Sep 5, 2024
1 parent 5997499 commit df70c70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions vidformer/src/av/muxer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ impl Muxer {
let output_path = CString::new(output_path).unwrap();
let mut ofmt_ctx: *mut ffi::AVFormatContext = ptr::null_mut();

let format_name_cstr: Option<CString> = match format_name {
Some(name) => Some(CString::new(name).unwrap()),
None => None,
};
let format_name_cstr: Option<CString> = format_name.map(|name| CString::new(name).unwrap());

if unsafe {
ffi::avformat_alloc_output_context2(
Expand Down
2 changes: 1 addition & 1 deletion vidformer/src/dve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ fn encoder_thread(
&output_path,
encoder_codec_params,
&output_time_base,
config.format.as_ref().map(|x| x.as_str()),
config.format.as_deref(),
)?;
let muxer_time_base = crate::util::avrat_to_rat(&muxer.out_time_base);
let encoder_to_muxer_ts_multiplier: num_rational::Ratio<i64> =
Expand Down
6 changes: 3 additions & 3 deletions vidformer/src/filter/builtin/drawutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ pub(crate) unsafe fn ff_copy_rectangle2(
let src_linesize = std::slice::from_raw_parts_mut(src_linesize, draw.nb_planes as usize);

for plane in 0..draw.nb_planes as usize {
let mut p = pointer_at(draw, &src, src_linesize, plane, src_x, src_y);
let mut q = pointer_at(draw, &dst, dst_linesize, plane, dst_x, dst_y);
let mut p = pointer_at(draw, src, src_linesize, plane, src_x, src_y);
let mut q = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
let wp =
((w + (1 << draw.hsub[plane]) - 1) >> draw.hsub[plane]) * draw.pixelstep[plane];
let hp = (h + (1 << draw.vsub[plane]) - 1) >> draw.vsub[plane];
Expand Down Expand Up @@ -351,7 +351,7 @@ pub(crate) unsafe fn ff_fill_rectangle(
let dst_linesize = std::slice::from_raw_parts_mut(dst_linesize, draw.nb_planes as usize);

for plane in 0..draw.nb_planes as usize {
let p0 = pointer_at(draw, &dst, dst_linesize, plane, dst_x, dst_y);
let p0 = pointer_at(draw, dst, dst_linesize, plane, dst_x, dst_y);
let wp = ((w + (1 << draw.hsub[plane]) - 1) >> draw.hsub[plane]) as usize;
let hp = ((h + (1 << draw.vsub[plane]) - 1) >> draw.vsub[plane]) as usize;
if hp == 0 {
Expand Down

0 comments on commit df70c70

Please sign in to comment.