diff options
author | Jörg Müller <nexyon@gmail.com> | 2019-01-17 23:17:30 +0300 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2019-01-17 23:17:30 +0300 |
commit | d3e856cdfc0f184c230166046dd939baa0ac7a28 (patch) | |
tree | 4247f4e4b0c36a80618a2148575a547533da7b1b /extern/audaspace/src/respec | |
parent | 16fac2149b7ec830dc5ef2f9ebbfcd226ecec581 (diff) |
Audaspace: porting changes from upstream.
- Silence some warnings.
- Fix: Python API memory leak.
- Fix for T54490: VSE breaks when I insert or remove headphones
Diffstat (limited to 'extern/audaspace/src/respec')
-rw-r--r-- | extern/audaspace/src/respec/ChannelMapperReader.cpp | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/extern/audaspace/src/respec/ChannelMapperReader.cpp b/extern/audaspace/src/respec/ChannelMapperReader.cpp index 850e54b73cf..1af5e70bfc8 100644 --- a/extern/audaspace/src/respec/ChannelMapperReader.cpp +++ b/extern/audaspace/src/respec/ChannelMapperReader.cpp @@ -296,72 +296,77 @@ const Channel* ChannelMapperReader::CHANNEL_MAPS[] = ChannelMapperReader::SURROUND71_MAP }; +constexpr float deg2rad(double angle) +{ + return float(angle * M_PI / 180.0); +} + const float ChannelMapperReader::MONO_ANGLES[] = { - 0.0f * M_PI / 180.0f + deg2rad(0.0) }; const float ChannelMapperReader::STEREO_ANGLES[] = { - -90.0f * M_PI / 180.0f, - 90.0f * M_PI / 180.0f + deg2rad(-90.0), + deg2rad( 90.0) }; const float ChannelMapperReader::STEREO_LFE_ANGLES[] = { - -90.0f * M_PI / 180.0f, - 90.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f + deg2rad(-90.0), + deg2rad( 90.0), + deg2rad( 0.0) }; const float ChannelMapperReader::SURROUND4_ANGLES[] = { - -45.0f * M_PI / 180.0f, - 45.0f * M_PI / 180.0f, - -135.0f * M_PI / 180.0f, - 135.0f * M_PI / 180.0f + deg2rad( -45.0), + deg2rad( 45.0), + deg2rad(-135.0), + deg2rad( 135.0) }; const float ChannelMapperReader::SURROUND5_ANGLES[] = { - -30.0f * M_PI / 180.0f, - 30.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - -110.0f * M_PI / 180.0f, - 110.0f * M_PI / 180.0f + deg2rad( -30.0), + deg2rad( 30.0), + deg2rad( 0.0), + deg2rad(-110.0), + deg2rad( 110.0) }; const float ChannelMapperReader::SURROUND51_ANGLES[] = { - -30.0f * M_PI / 180.0f, - 30.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - -110.0f * M_PI / 180.0f, - 110.0f * M_PI / 180.0f + deg2rad( -30.0), + deg2rad( 30.0), + deg2rad( 0.0), + deg2rad( 0.0), + deg2rad(-110.0), + deg2rad( 110.0) }; const float ChannelMapperReader::SURROUND61_ANGLES[] = { - -30.0f * M_PI / 180.0f, - 30.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - 180.0f * M_PI / 180.0f, - -110.0f * M_PI / 180.0f, - 110.0f * M_PI / 180.0f + deg2rad( -30.0), + deg2rad( 30.0), + deg2rad( 0.0), + deg2rad( 0.0), + deg2rad( 180.0), + deg2rad(-110.0), + deg2rad( 110.0) }; const float ChannelMapperReader::SURROUND71_ANGLES[] = { - -30.0f * M_PI / 180.0f, - 30.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - 0.0f * M_PI / 180.0f, - -110.0f * M_PI / 180.0f, - 110.0f * M_PI / 180.0f, - -150.0f * M_PI / 180.0f, - 150.0f * M_PI / 180.0f + deg2rad( -30.0), + deg2rad( 30.0), + deg2rad( 0.0), + deg2rad( 0.0), + deg2rad(-110.0), + deg2rad( 110.0), + deg2rad(-150.0), + deg2rad( 150.0) }; const float* ChannelMapperReader::CHANNEL_ANGLES[] = |