@@ -841,26 +841,28 @@ impl AudioProcessor for PannerRenderer {
841
841
&& listener_up_z. len ( ) == 1 ;
842
842
843
843
if single_valued {
844
+ let param_value = a_rate_params. next ( ) . unwrap ( ) ;
844
845
match input. number_of_channels ( ) {
845
846
1 => {
846
847
* output = input. clone ( ) ;
847
848
output. mix ( 2 , ChannelInterpretation :: Speakers ) ;
848
849
let [ left, right] = output. stereo_mut ( ) ;
849
- std:: iter:: repeat ( a_rate_params. next ( ) . unwrap ( ) )
850
- . zip ( & mut left[ ..] )
850
+ left. iter_mut ( )
851
851
. zip ( & mut right[ ..] )
852
- . for_each ( |( ( p , l ) , r) | apply_mono_to_stereo_gain ( p , l, r) ) ;
852
+ . for_each ( |( l , r) | apply_mono_to_stereo_gain ( param_value , l, r) ) ;
853
853
}
854
854
2 => {
855
855
output. set_number_of_channels ( 2 ) ;
856
856
let [ left, right] = output. stereo_mut ( ) ;
857
- std:: iter:: repeat ( a_rate_params. next ( ) . unwrap ( ) )
858
- . zip ( input. channel_data ( 0 ) . iter ( ) . copied ( ) )
857
+ input
858
+ . channel_data ( 0 )
859
+ . iter ( )
860
+ . copied ( )
859
861
. zip ( input. channel_data ( 1 ) . iter ( ) . copied ( ) )
860
862
. zip ( & mut left[ ..] )
861
863
. zip ( & mut right[ ..] )
862
- . for_each ( |( ( ( ( p , il ) , ir) , ol) , or) | {
863
- apply_stereo_to_stereo_gain ( p , il, ir, ol, or)
864
+ . for_each ( |( ( ( il , ir) , ol) , or) | {
865
+ apply_stereo_to_stereo_gain ( param_value , il, ir, ol, or)
864
866
} ) ;
865
867
}
866
868
_ => unreachable ! ( ) ,
0 commit comments