Fixed NullSound hanging on movies. Compared to DSound, it's now slower on movies but faster in menus

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2183 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-02-09 19:50:06 +00:00
parent 59a8fd4848
commit 09c8368180
8 changed files with 52 additions and 38 deletions

View File

@ -110,8 +110,7 @@ void DSound::SoundLoop() {
// No blocking inside the csection
soundCriticalSection->Enter();
dsBuffer->GetCurrentPosition((DWORD*)&currentPos, 0);
int numBytesToRender = FIX128(
ModBufferSize(currentPos - lastPos));
int numBytesToRender = FIX128(ModBufferSize(currentPos - lastPos));
if (numBytesToRender >= 256)
{

View File

@ -68,13 +68,7 @@ void Mixer(short *buffer, int numSamples, int bits, int rate, int channels)
g_dspInitialize.pGetAudioStreaming(buffer, numSamples);
}
//if this was called directly from the HLE, and not by timeout
if (g_Config.m_EnableHLEAudio && mixer_HLEready)
{
IUCode* pUCode = CDSPHandler::GetInstance().GetUCode();
if (pUCode != NULL)
pUCode->MixAdd(buffer, numSamples);
}
Mixer_MixUCode(buffer, numSamples, bits, rate, channels);
push_sync.Enter();
int count = 0;
@ -96,6 +90,17 @@ void Mixer(short *buffer, int numSamples, int bits, int rate, int channels)
push_sync.Leave();
}
void Mixer_MixUCode(short *buffer, int numSamples, int bits, int rate,
int channels) {
//if this was called directly from the HLE, and not by timeout
if (g_Config.m_EnableHLEAudio && mixer_HLEready)
{
IUCode* pUCode = CDSPHandler::GetInstance().GetUCode();
if (pUCode != NULL)
pUCode->MixAdd(buffer, numSamples);
}
}
void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate) {
// static FILE *f;
// if (!f)

View File

@ -23,6 +23,8 @@ extern volatile bool mixer_HLEready;
// Called from audio threads
void Mixer(short* buffer, int numSamples, int bits, int rate, int channels);
void Mixer_MixUCode(short *buffer, int numSamples, int bits, int rate, int channels);
// Called from main thread
void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate);

View File

@ -33,6 +33,10 @@ public:
}
virtual bool Start() { return true; }
virtual void Update() {
(*callback)(NULL, 256 >> 2, 16, sampleRate, 2);
}
};
#endif //__NULLSOUNDSTREAM_H__