diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-04-23 18:05:21 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-06-03 16:53:59 -0700 |
| commit | a4508e85e8b63e085eac9dca877fae9f7d65e09a (patch) | |
| tree | 24dc9c24b1ba4aaf85d0d0ae31fe8b8c05ee6922 /Source/Core/AudioCommon/PulseAudioStream.cpp | |
| parent | 0e6bd74ed626dd25a85682b90426c26cb10d6a16 (diff) | |
AudioCommon: move DPL2 decoding into Mixer
Diffstat (limited to 'Source/Core/AudioCommon/PulseAudioStream.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/PulseAudioStream.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/Source/Core/AudioCommon/PulseAudioStream.cpp b/Source/Core/AudioCommon/PulseAudioStream.cpp index e6e6a45ce2..827816d4e8 100644 --- a/Source/Core/AudioCommon/PulseAudioStream.cpp +++ b/Source/Core/AudioCommon/PulseAudioStream.cpp @@ -4,7 +4,6 @@ #include <cstring> -#include "AudioCommon/DPL2Decoder.h" #include "AudioCommon/PulseAudioStream.h" #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" @@ -30,9 +29,6 @@ bool PulseAudio::Start() m_run_thread.Set(); m_thread = std::thread(&PulseAudio::SoundLoop, this); - // Initialize DPL2 parameters - DPL2Reset(); - return true; } @@ -194,23 +190,12 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length) } else { - // get a floating point mix - s16 s16buffer_stereo[frames * 2]; - m_mixer->Mix(s16buffer_stereo, frames); // implicitly mixes to 16-bit stereo - - float floatbuffer_stereo[frames * 2]; - // s16 to float - for (int i = 0; i < frames * 2; ++i) - { - floatbuffer_stereo[i] = s16buffer_stereo[i] / float(1 << 15); - } - if (m_channels == 5) // Extract dpl2/5.0 Surround { float floatbuffer_6chan[frames * 6]; - // DPL2Decode output: LEFTFRONT, RIGHTFRONT, CENTREFRONT, (sub), LEFTREAR, RIGHTREAR - DPL2Decode(floatbuffer_stereo, frames, floatbuffer_6chan); + m_mixer->MixSurround(floatbuffer_6chan, frames); + // DPL2Decode output: LEFTFRONT, RIGHTFRONT, CENTREFRONT, (sub), LEFTREAR, RIGHTREAR // Discard the subwoofer channel - DPL2Decode generates a pretty // good 5.0 but not a good 5.1 output. const int dpl2_to_5chan[] = {0, 1, 2, 4, 5}; |
