diff --git a/src/software/resampling/context.rs b/src/software/resampling/context.rs index 330733b0..1d30cf45 100644 --- a/src/software/resampling/context.rs +++ b/src/software/resampling/context.rs @@ -149,12 +149,7 @@ impl Context { /// Get the remaining delay. pub fn delay(&self) -> Option { - unsafe { - match swr_get_delay(self.as_ptr() as *mut _, 1) { - 0 => None, - _ => Some(Delay::from(self)), - } - } + unsafe { Some(Delay::from(self)).filter(|d| d.output > 0) } } /// Run the resampler from the given input to the given output. diff --git a/src/util/frame/audio.rs b/src/util/frame/audio.rs index c9a61720..52078d8b 100644 --- a/src/util/frame/audio.rs +++ b/src/util/frame/audio.rs @@ -200,7 +200,7 @@ impl Audio { unsafe { slice::from_raw_parts( (*self.as_ptr()).data[index], - (*self.as_ptr()).linesize[index] as usize, + (*self.as_ptr()).linesize[0] as usize, ) } } @@ -214,7 +214,7 @@ impl Audio { unsafe { slice::from_raw_parts_mut( (*self.as_mut_ptr()).data[index], - (*self.as_ptr()).linesize[index] as usize, + (*self.as_ptr()).linesize[0] as usize, ) } } diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index 501319a8..9fd2a32a 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -69,6 +69,8 @@ pub enum Type { LCEVC, #[cfg(feature = "ffmpeg_7_1")] VIEW_ID, + #[cfg(feature = "ffmpeg_7_1")] + DOVI_RPU_BUFFER_T35, } impl Type { @@ -142,6 +144,9 @@ impl From for Type { AV_FRAME_DATA_LCEVC => Type::LCEVC, #[cfg(feature = "ffmpeg_7_1")] AV_FRAME_DATA_VIEW_ID => Type::VIEW_ID, + #[cfg(feature = "ffmpeg_7_1")] + AV_FRAME_DATA_DOVI_RPU_BUFFER_T35 => Type::DOVI_RPU_BUFFER_T35, + _ => unimplemented!(), } } } @@ -208,6 +213,8 @@ impl From for AVFrameSideDataType { Type::LCEVC => AV_FRAME_DATA_LCEVC, #[cfg(feature = "ffmpeg_7_1")] Type::VIEW_ID => AV_FRAME_DATA_VIEW_ID, + #[cfg(feature = "ffmpeg_7_1")] + Type::DOVI_RPU_BUFFER_T35 => AV_FRAME_DATA_DOVI_RPU_BUFFER, } } }