mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 04:38:49 +00:00
a NEED DEBUG version of openal sound system, nakee, try to FIX it! :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3409 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
b8d3cae6e3
commit
ff0ec2b3f8
4 changed files with 42 additions and 24 deletions
|
@ -25,18 +25,18 @@
|
|||
#include "FixedSizeQueue.h"
|
||||
#include "AudioCommon.h"
|
||||
|
||||
void CMixer::Mix(short *samples, int numSamples)
|
||||
int CMixer::Mix(short *samples, int numSamples)
|
||||
{
|
||||
if (! samples) {
|
||||
Premix(NULL, 0);
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
// silence
|
||||
memset(samples, 0, numSamples * 2 * sizeof(short));
|
||||
|
||||
if (g_dspInitialize.pEmulatorState) {
|
||||
if (*g_dspInitialize.pEmulatorState != 0)
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// first get the DTK Music
|
||||
|
@ -46,9 +46,11 @@ void CMixer::Mix(short *samples, int numSamples)
|
|||
|
||||
Premix(samples, numSamples);
|
||||
|
||||
push_sync.Enter();
|
||||
int count = 0;
|
||||
while (m_queueSize > queue_minlength && count < numSamples * 2) {
|
||||
|
||||
push_sync.Enter();
|
||||
while (m_queueSize > queue_minlength && count < numSamples * 2)
|
||||
{
|
||||
int x = samples[count];
|
||||
x += sample_queue.front();
|
||||
if (x > 32767) x = 32767;
|
||||
|
@ -64,6 +66,8 @@ void CMixer::Mix(short *samples, int numSamples)
|
|||
m_queueSize-=2;
|
||||
}
|
||||
push_sync.Leave();
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue