From 3004f5fc7d9f3ef05ed96ed1775509d5e78613ea Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Fri, 17 Feb 2017 17:55:30 +0800 Subject: Fix weird commen indent and modify code for mix_remap --- src/cubeb_mixer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cubeb_mixer.cpp') 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; -- cgit v1.2.3