Skip to content

Commit

Permalink
fix warning for unused output_channel and format
Browse files Browse the repository at this point in the history
  • Loading branch information
Pehrsons committed Apr 11, 2024
1 parent 97d69f2 commit 5a0b1bb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/coefficient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,34 +94,34 @@ where
|| *channel == Channel::FrontLeft
|| *channel == Channel::FrontRight;
}
let coefficient_matrix = if only_stereo_or_discrete && output_channels.len() >2 && input_channels.len() <= output_channels.len() {
let coefficient_matrix = if only_stereo_or_discrete
&& output_channels.len() > 2
&& input_channels.len() <= output_channels.len()
{
let mut matrix = Vec::with_capacity(output_channels.len());
let mut idx = 0;
// Create a diagonal line of 1.0 for input channels
for output_channel in output_channels {
let output_channel_index = idx;
idx+=1;
for (output_channel_index, _) in output_channels.iter().enumerate() {
let mut coefficients = Vec::with_capacity(input_channels.len());
coefficients.resize(input_channels.len(), 0.0);
if output_channel_index < coefficients.len() {
coefficients[output_channel_index] = 1.0;
}
matrix.push(coefficients);
}
matrix
matrix
} else {
let mixing_matrix = Self::build_mixing_matrix(input_layout.channel_map, output_layout.channel_map)
.unwrap_or_else(|_| Self::get_basic_matrix());
let mixing_matrix =
Self::build_mixing_matrix(input_layout.channel_map, output_layout.channel_map)
.unwrap_or_else(|_| Self::get_basic_matrix());
Self::pick_coefficients(
&input_layout.channels,
&output_layout.channels,
&mixing_matrix,
)
};

println!("coeffs {:?}", coefficient_matrix);


for row in coefficient_matrix.iter() {
println!("{:?}", row);
}
Expand Down

0 comments on commit 5a0b1bb

Please # to comment.