diff options
author | Chun-Min Chang <[email protected]> | 2017-05-25 14:51:26 +0800 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2017-05-26 14:17:34 +1200 |
commit | 290e63580080839cbada6a6f8b27c3cfe623c56a (patch) | |
tree | 092b270d8ee699bdc15f89cabe350f213ff2a6cf /test | |
parent | 4efb2e695630d289c01bcb4bbd5c4505d37f4e0e (diff) | |
download | cubeb-290e63580080839cbada6a6f8b27c3cfe623c56a.tar.gz cubeb-290e63580080839cbada6a6f8b27c3cfe623c56a.zip |
Add osx-specific setting for downmixing test
Diffstat (limited to 'test')
-rw-r--r-- | test/test_mixer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_mixer.cpp b/test/test_mixer.cpp index a7c10e5..69cbf85 100644 --- a/test/test_mixer.cpp +++ b/test/test_mixer.cpp @@ -88,6 +88,7 @@ audio_input audio_inputs[CUBEB_LAYOUT_MAX] = { { CUBEB_LAYOUT_3F4_LFE, { L, R, C, LFE, RLS, RRS, LS, RS } } }; +// The test cases must be aligned with cubeb_downmix. void downmix_test(float const * data, cubeb_channel_layout in_layout, cubeb_channel_layout out_layout) { @@ -126,7 +127,14 @@ downmix_test(float const * data, cubeb_channel_layout in_layout, cubeb_channel_l unsigned int const inframes = 10; vector<float> in(in_params.channels * inframes); +#if defined(__APPLE__) + // The mixed buffer size doesn't be changed based on the channel layout set on OSX. + // Please see the comment above downmix_3f2 in cubeb_mixer.cpp. + vector<float> out(in_params.channels * inframes); +#else + // In normal case, the mixed buffer size is based on the mixing channel layout. vector<float> out(out_params.channels * inframes); +#endif for (unsigned int offset = 0 ; offset < inframes * in_params.channels ; offset += in_params.channels) { for (unsigned int i = 0 ; i < in_params.channels ; ++i) { @@ -162,6 +170,11 @@ downmix_test(float const * data, cubeb_channel_layout in_layout, cubeb_channel_l continue; } +#if defined(__APPLE__) + // We only support downmix for audio 5.1 on OS X currently. + return; +#endif + // mix_remap if (out_layout_mask & in_layout_mask) { uint32_t mask = 1 << CHANNEL_INDEX_TO_ORDER[out_layout][index]; |