From bb11e998e759b0332c22703844f448fb2ea3b4b5 Mon Sep 17 00:00:00 2001 From: kieran Date: Mon, 18 Nov 2024 16:24:02 +0000 Subject: [PATCH] fix: remove useless param --- src/resample.rs | 5 +---- src/transcode.rs | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/resample.rs b/src/resample.rs index 0169967..a0f4c55 100644 --- a/src/resample.rs +++ b/src/resample.rs @@ -65,8 +65,7 @@ impl Resample { /// Resample an audio frame pub unsafe fn process_frame( &mut self, - frame: *mut AVFrame, - frame_size: i32, + frame: *mut AVFrame ) -> Result<*mut AVFrame, Error> { if !(*frame).hw_frames_ctx.is_null() { anyhow::bail!("Hardware frames are not supported in this software re-sampler"); @@ -77,8 +76,6 @@ impl Resample { av_frame_copy_props(out_frame, frame); (*out_frame).sample_rate = self.sample_rate as libc::c_int; (*out_frame).format = transmute(self.format); - (*out_frame).nb_samples = frame_size; - av_channel_layout_default(&mut (*out_frame).ch_layout, self.channels as libc::c_int); let ret = swr_convert_frame(self.ctx, out_frame, frame); diff --git a/src/transcode.rs b/src/transcode.rs index abe9ceb..cd7b2d4 100644 --- a/src/transcode.rs +++ b/src/transcode.rs @@ -126,8 +126,7 @@ impl Transcoder { // resample audio frame before encoding let mut frame = if let Some(swr) = self.resampler.get_mut(&src_index) { - let frame_size = (*enc.codec_context()).frame_size; - swr.process_frame(frame, frame_size)? + swr.process_frame(frame)? } else { frame };