summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2013-02-23 17:02:58 +1300
committerMatthew Parlane <parlane@gmail.com>2013-02-23 17:02:58 +1300
commitc30b8c9eae8a72747bf7da77f40f20b35c3d712a (patch)
tree5fbb01b93f8dff848936132b6e2fac964bbac7e4 /Source/Core/AudioCommon
parent3d480c088fa27c6dcadef40042a0e8deb3093985 (diff)
parentba979582e2d0b4961f1087b76eef659856eb23bb (diff)
Merge branch 'master' into wii-network
Conflicts: Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
Diffstat (limited to 'Source/Core/AudioCommon')
-rw-r--r--Source/Core/AudioCommon/Src/OpenALStream.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp
index 6b239a584c..7d1c45175b 100644
--- a/Source/Core/AudioCommon/Src/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp
@@ -200,6 +200,7 @@ void OpenALStream::SoundLoop()
u64 num_samples_to_render = (audio_dma_period * ais_samples_per_second) / SystemTimers::GetTicksPerSecond();
unsigned int numSamples = (unsigned int)num_samples_to_render;
+ unsigned int minSamples = surround_capable ? 240 : 0; // DPL2 accepts 240 samples minimum (FWRDURATION)
numSamples = (numSamples > OAL_MAX_SAMPLES) ? OAL_MAX_SAMPLES : numSamples;
numSamples = m_mixer->Mix(realtimeBuffer, numSamples);
@@ -236,9 +237,15 @@ void OpenALStream::SoundLoop()
// Adjust SETTING_SEQUENCE_MS to balance between lag vs hollow audio
soundTouch.setSetting(SETTING_SEQUENCE_MS, (int)(1 / (rate * rate)));
soundTouch.setTempo(rate);
+ if (rate > 10)
+ {
+ soundTouch.clear();
+ }
}
- unsigned int nSamples = soundTouch.receiveSamples(sampleBuffer, OAL_MAX_SAMPLES * SIZE_FLOAT * SURROUND_CHANNELS * OAL_MAX_BUFFERS);
- if (nSamples > 0)
+
+ unsigned int nSamples = soundTouch.receiveSamples(sampleBuffer, OAL_MAX_SAMPLES * SIZE_FLOAT * OAL_MAX_BUFFERS);
+
+ if (nSamples > minSamples)
{
// Remove the Buffer from the Queue. (uiBuffer contains the Buffer ID for the unqueued Buffer)
if (iBuffersFilled == 0)