diff --git a/mux/mp4/tests/tests.rs b/mux/mp4/tests/tests.rs index b9e7081ee..52b91f599 100644 --- a/mux/mp4/tests/tests.rs +++ b/mux/mp4/tests/tests.rs @@ -1246,7 +1246,7 @@ fn test_taic_stai_encode(video_enc: &str, enabled: bool) { let stbl = &moov.trak.first().unwrap().mdia.minf.stbl; let saio = stbl.saio.as_ref().unwrap(); let saiz = stbl.saiz.as_ref().unwrap(); - if mdat_data.is_some() { + if let Some(ref mdat_data) = mdat_data { assert_eq!( saio.aux_info.as_ref().unwrap().aux_info_type, b"stai".into() @@ -1262,18 +1262,16 @@ fn test_taic_stai_encode(video_enc: &str, enabled: bool) { let len = saiz.default_sample_info_size as u64; let offset_into_mdat_start = (offset - mdat_offset) as usize; let offset_into_mdat_end = offset_into_mdat_start + len as usize; - let vec = &mdat_data.as_ref().unwrap() - [offset_into_mdat_start..offset_into_mdat_end] - .to_vec(); - assert_eq!(vec.len(), 9); + let slice = &mdat_data[offset_into_mdat_start..offset_into_mdat_end]; + assert_eq!(slice.len(), 9); let mut timestamp_bytes: [u8; 8] = [0; 8]; - timestamp_bytes.copy_from_slice(&vec.as_slice()[0..8]); + timestamp_bytes.copy_from_slice(&slice[0..8]); let timestamp = u64::from_be_bytes(timestamp_bytes); assert_eq!( timestamp, tai_nanos_initial_offset + (i as u64) * tai_nanos_per_frame_step ); - assert_eq!(vec[8], 0x80); + assert_eq!(slice[8], 0x80); } } else { panic!("mdat should not be none"); diff --git a/net/hlsmultivariantsink/src/lib.rs b/net/hlsmultivariantsink/src/lib.rs index 008cdeddc..df05effbb 100644 --- a/net/hlsmultivariantsink/src/lib.rs +++ b/net/hlsmultivariantsink/src/lib.rs @@ -15,6 +15,7 @@ use gst::glib; use gst::prelude::*; +#[allow(unused)] mod cros_codecs; mod imp; diff --git a/net/ndi/src/ndi.rs b/net/ndi/src/ndi.rs index 26a026ce1..6198a0f03 100644 --- a/net/ndi/src/ndi.rs +++ b/net/ndi/src/ndi.rs @@ -631,7 +631,7 @@ impl VideoFrame { } #[cfg(feature = "advanced-sdk")] - pub fn compressed_packet(&self) -> Option { + pub fn compressed_packet(&self) -> Option> { use byteorder::{LittleEndian, ReadBytesExt}; use std::io::Cursor; use std::slice; @@ -987,7 +987,7 @@ impl AudioFrame { } #[cfg(feature = "advanced-sdk")] - pub fn compressed_packet(&self) -> Option { + pub fn compressed_packet(&self) -> Option> { use byteorder::{LittleEndian, ReadBytesExt}; use std::io::Cursor; use std::slice; diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index e1a2602b8..9093d94ce 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -142,7 +142,7 @@ impl State { fn line( &mut self, drain: bool, - ) -> Result, (&[u8], winnow::error::ContextError)> { + ) -> Result>, (&[u8], winnow::error::ContextError)> { let line = if self.replay_last_line { self.replay_last_line = false; &self.last_raw_line @@ -466,8 +466,8 @@ impl MccParse { fn handle_skipped_line( &self, tc: TimeCode, - mut state: MutexGuard, - ) -> Result, gst::FlowError> { + mut state: MutexGuard<'_, State>, + ) -> Result, gst::FlowError> { let (framerate, drop_frame) = parse_timecode_rate(state.timecode_rate)?; let timecode = state.handle_timecode(self, framerate, drop_frame, tc)?; let nsecs = timecode.time_since_daily_jam(); @@ -495,8 +495,8 @@ impl MccParse { tc: TimeCode, data: Vec, format: Format, - mut state: MutexGuard, - ) -> Result, gst::FlowError> { + mut state: MutexGuard<'_, State>, + ) -> Result, gst::FlowError> { let (framerate, drop_frame) = parse_timecode_rate(state.timecode_rate)?; let events = state.create_events(self, Some(format), framerate); let timecode = state.handle_timecode(self, framerate, drop_frame, tc)?; @@ -829,7 +829,7 @@ impl MccParse { self.handle_buffer(Some(buffer), false) } - fn flush(&self, mut state: MutexGuard) -> MutexGuard { + fn flush(&self, mut state: MutexGuard<'_, State>) -> MutexGuard<'_, State> { state.reader.clear(); state.parser.reset(); if let Some(pull) = &mut state.pull { diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index 506044ee3..7ed92b9e1 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -325,8 +325,8 @@ impl SccParse { &self, tc: TimeCode, data: Vec, - mut state: MutexGuard, - ) -> Result, gst::FlowError> { + mut state: MutexGuard<'_, State>, + ) -> Result, gst::FlowError> { gst::trace!( CAT, imp = self, @@ -732,7 +732,7 @@ impl SccParse { self.handle_buffer(Some(buffer)) } - fn flush(&self, mut state: MutexGuard) -> MutexGuard { + fn flush(&self, mut state: MutexGuard<'_, State>) -> MutexGuard<'_, State> { state.reader.clear(); state.parser.reset(); if let Some(pull) = &mut state.pull { diff --git a/video/webp/src/dec/imp.rs b/video/webp/src/dec/imp.rs index 5a758468a..ddfc48ec2 100644 --- a/video/webp/src/dec/imp.rs +++ b/video/webp/src/dec/imp.rs @@ -96,7 +96,7 @@ impl Decoder<'_> { } } - fn next(&mut self) -> Option { + fn next(&mut self) -> Option> { let mut buf = std::ptr::null_mut(); let buf_ptr: *mut *mut u8 = &mut buf; let mut timestamp: i32 = 0;