Skip to content

Commit 222e518

Browse files
committed
Fix: channel_config of ChannelMergerNode was incorrect
1 parent de6c1c4 commit 222e518

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/node/channel_merger.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ impl Default for ChannelMergerOptions {
6666
pub struct ChannelMergerNode {
6767
registration: AudioContextRegistration,
6868
channel_config: ChannelConfig,
69+
number_of_inputs: usize,
6970
}
7071

7172
impl AudioNode for ChannelMergerNode {
@@ -88,7 +89,7 @@ impl AudioNode for ChannelMergerNode {
8889
}
8990

9091
fn number_of_inputs(&self) -> usize {
91-
self.channel_count()
92+
self.number_of_inputs
9293
}
9394

9495
fn number_of_outputs(&self) -> usize {
@@ -100,14 +101,14 @@ impl ChannelMergerNode {
100101
pub fn new<C: BaseAudioContext>(context: &C, options: ChannelMergerOptions) -> Self {
101102
context.register(move |registration| {
102103
crate::assert_valid_number_of_channels(options.number_of_inputs);
103-
options.channel_config.count = options.number_of_inputs;
104104

105105
assert_valid_channel_count(options.channel_config.count);
106106
assert_valid_channel_count_mode(options.channel_config.count_mode);
107107

108108
let node = ChannelMergerNode {
109109
registration,
110110
channel_config: options.channel_config.into(),
111+
number_of_inputs: options.number_of_inputs,
111112
};
112113

113114
let render = ChannelMergerRenderer {};

0 commit comments

Comments
 (0)