Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/audio/mux/mux_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ void demux_prepare_look_up_table(struct comp_dev *dev)
for (j = 0; j < PLATFORM_MAX_CHANNELS; j++) {
for (k = 0; k < PLATFORM_MAX_CHANNELS; k++) {
if (cd->config.streams[i].mask[j] & BIT(k)) {
/* MUX component has only one sink */
cd->lookup[i].copy_elem[idx].in_ch = j;
cd->lookup[i].copy_elem[idx].out_ch = k;
/* DEMUX component has only one source */
cd->lookup[i].copy_elem[idx].in_ch = k;
cd->lookup[i].copy_elem[idx].out_ch = j;
cd->lookup[i].copy_elem[idx].stream_id =
i;
cd->lookup[i].num_elems = ++idx;
Expand Down
6 changes: 3 additions & 3 deletions test/cmocka/src/audio/mux/demux_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void test_demux_copy_proc_16(void **state)
int64_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][k] & BIT(j))
if (td->mask[i][j] & BIT(k))
sample = input_16b[k];

expected_results[i][j] = sample;
Expand All @@ -222,7 +222,7 @@ static void test_demux_copy_proc_24(void **state)
int32_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][k] & BIT(j))
if (td->mask[i][j] & BIT(k))
sample = input_24b[k];

expected_results[i][j] = sample;
Expand All @@ -247,7 +247,7 @@ static void test_demux_copy_proc_32(void **state)
int32_t sample = 0;

for (k = 0; k < PLATFORM_MAX_CHANNELS; ++k)
if (td->mask[i][k] & BIT(j))
if (td->mask[i][j] & BIT(k))
sample = input_32b[k];

expected_results[i][j] = sample;
Expand Down