diff options
author | Chun-Min Chang <[email protected]> | 2017-02-17 17:55:30 +0800 |
---|---|---|
committer | Alex Chronopoulos <[email protected]> | 2017-03-15 13:07:50 +0100 |
commit | 3004f5fc7d9f3ef05ed96ed1775509d5e78613ea (patch) | |
tree | 4a4c8647cf103dba88a0071cf3d8cb51abce6e35 /src/cubeb_mixer.cpp | |
parent | 4a8f4ddd4fb0c413223af1e5aa8240d6827cef70 (diff) | |
download | cubeb-3004f5fc7d9f3ef05ed96ed1775509d5e78613ea.tar.gz cubeb-3004f5fc7d9f3ef05ed96ed1775509d5e78613ea.zip |
Fix weird commen indent and modify code for mix_remap
Diffstat (limited to 'src/cubeb_mixer.cpp')
-rw-r--r-- | src/cubeb_mixer.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cubeb_mixer.cpp b/src/cubeb_mixer.cpp index 1cdbfd2..33d8f74 100644 --- a/src/cubeb_mixer.cpp +++ b/src/cubeb_mixer.cpp @@ -81,7 +81,7 @@ cubeb_layout_map const CUBEB_CHANNEL_LAYOUT_MAPS[CUBEB_LAYOUT_MAX] = { }; static int const CHANNEL_ORDER_TO_INDEX[CUBEB_LAYOUT_MAX][CHANNEL_MAX] = { - // M | L | R | C | LS | RS | RLS | RC | RRS | LFE +// M | L | R | C | LS | RS | RLS | RC | RRS | LFE { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // UNDEFINED { -1, 0, 1, -1, -1, -1, -1, -1, -1, -1 }, // DUAL_MONO { -1, 0, 1, -1, -1, -1, -1, -1, -1, 2 }, // DUAL_MONO_LFE @@ -256,8 +256,7 @@ mix_remap(T const * const in, unsigned long inframes, T * out, cubeb_channel_lay return false; } - long out_index = 0; - for (unsigned long i = 0; i < inframes * in_channels; i += in_channels) { + for (unsigned long i = 0, out_index = 0; i < inframes * in_channels; i += in_channels, out_index += out_channels) { for (unsigned int j = 0; j < out_channels; ++j) { cubeb_channel channel = CHANNEL_INDEX_TO_ORDER[out_layout][j]; uint32_t channel_mask = 1 << channel; @@ -270,7 +269,6 @@ mix_remap(T const * const in, unsigned long inframes, T * out, cubeb_channel_lay out[out_index + j] = 0; } } - out_index += out_channels; } return true; |