Ignore large (negative) audio DMA buffer

This commit is contained in:
zilmar 2012-11-06 19:09:56 +11:00
parent 5b67891d9e
commit 4a3fb18f6a
1 changed files with 10 additions and 5 deletions

View File

@ -38,6 +38,10 @@ void CAudio::LenChanged ( void )
WriteTraceF(TraceAudio,__FUNCTION__ ": _Reg->AI_LEN_REG = %d",_Reg->AI_LEN_REG); WriteTraceF(TraceAudio,__FUNCTION__ ": _Reg->AI_LEN_REG = %d",_Reg->AI_LEN_REG);
if (_Reg->AI_LEN_REG != 0) if (_Reg->AI_LEN_REG != 0)
{ {
if (_Reg->AI_LEN_REG > 0x8000)
{
WriteTraceF(TraceAudio,__FUNCTION__ ": Ignoring Write, To Large (%X)",_Reg->AI_LEN_REG);
} else {
if (GetLength() == 0) if (GetLength() == 0)
{ {
WriteTraceF(TraceAudio,__FUNCTION__ ": Set Timer AI_LEN_REG: %d m_CountsPerByte: %d",_Reg->AI_LEN_REG,m_CountsPerByte); WriteTraceF(TraceAudio,__FUNCTION__ ": Set Timer AI_LEN_REG: %d m_CountsPerByte: %d",_Reg->AI_LEN_REG,m_CountsPerByte);
@ -46,6 +50,7 @@ void CAudio::LenChanged ( void )
m_SecondBuff = _Reg->AI_LEN_REG; m_SecondBuff = _Reg->AI_LEN_REG;
m_Status |= 0x80000000; m_Status |= 0x80000000;
} }
}
} else { } else {
_SystemTimer->StopTimer(CSystemTimer::AiTimer); _SystemTimer->StopTimer(CSystemTimer::AiTimer);
m_SecondBuff = 0; m_SecondBuff = 0;