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

@ -326,7 +326,7 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
#if defined(HAVE_WX) && HAVE_WX
// write logging data to debugger
if (m_frame)
if (m_frame && _pBuffer)
{
CUCode_AX::Logging(_pBuffer, _iSize, 0, false);
}
@ -383,22 +383,23 @@ void CUCode_AX::MixAdd(short* _pBuffer, int _iSize)
// write back out pbs
WriteBackPBs(m_addressPBs, PBs, numberOfPBs);
for (int i = 0; i < _iSize; i++)
{
// Clamp into 16-bit. Maybe we should add a volume compressor here.
int left = templbuffer[i] + _pBuffer[0];
int right = temprbuffer[i] + _pBuffer[1];
if (left < -32767) left = -32767;
if (left > 32767) left = 32767;
if (right < -32767) right = -32767;
if (right > 32767) right = 32767;
*_pBuffer++ = left;
*_pBuffer++ = right;
if(_pBuffer) {
for (int i = 0; i < _iSize; i++)
{
// Clamp into 16-bit. Maybe we should add a volume compressor here.
int left = templbuffer[i] + _pBuffer[0];
int right = temprbuffer[i] + _pBuffer[1];
if (left < -32767) left = -32767;
if (left > 32767) left = 32767;
if (right < -32767) right = -32767;
if (right > 32767) right = 32767;
*_pBuffer++ = left;
*_pBuffer++ = right;
}
}
#if defined(HAVE_WX) && HAVE_WX
// write logging data to debugger again after the update
if (m_frame)
if (m_frame && _pBuffer)
{
CUCode_AX::Logging(_pBuffer, _iSize, 1, false);
}