fix: remove useless param

This commit is contained in:
kieran 2024-11-18 16:24:02 +00:00
parent 4c3e1dfccc
commit bb11e998e7
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
2 changed files with 2 additions and 6 deletions

View File

@ -65,8 +65,7 @@ impl Resample {
/// Resample an audio frame /// Resample an audio frame
pub unsafe fn process_frame( pub unsafe fn process_frame(
&mut self, &mut self,
frame: *mut AVFrame, frame: *mut AVFrame
frame_size: i32,
) -> Result<*mut AVFrame, Error> { ) -> Result<*mut AVFrame, Error> {
if !(*frame).hw_frames_ctx.is_null() { if !(*frame).hw_frames_ctx.is_null() {
anyhow::bail!("Hardware frames are not supported in this software re-sampler"); 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); av_frame_copy_props(out_frame, frame);
(*out_frame).sample_rate = self.sample_rate as libc::c_int; (*out_frame).sample_rate = self.sample_rate as libc::c_int;
(*out_frame).format = transmute(self.format); (*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); 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); let ret = swr_convert_frame(self.ctx, out_frame, frame);

View File

@ -126,8 +126,7 @@ impl Transcoder {
// resample audio frame before encoding // resample audio frame before encoding
let mut frame = if let Some(swr) = self.resampler.get_mut(&src_index) { 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)?
swr.process_frame(frame, frame_size)?
} else { } else {
frame frame
}; };