-sound buffer can stay in mem1

This commit is contained in:
fix94.1 2012-06-08 19:00:02 +00:00
parent 0272e193ad
commit 00419301c8
2 changed files with 62 additions and 62 deletions

View File

@ -51,9 +51,9 @@ void BufferCircle::SetBufferBlockSize(int size)
for(int i = 0; i < Size(); i++) for(int i = 0; i < Size(); i++)
{ {
if(SoundBuffer[i] != NULL) if(SoundBuffer[i] != NULL)
MEM2_free(SoundBuffer[i]); MEM1_free(SoundBuffer[i]);
SoundBuffer[i] = (u8 *)MEM2_memalign(32, BufferBlockSize); SoundBuffer[i] = (u8 *)MEM1_memalign(32, BufferBlockSize);
BufferSize[i] = 0; BufferSize[i] = 0;
BufferReady[i] = false; BufferReady[i] = false;
} }
@ -73,7 +73,7 @@ void BufferCircle::Resize(int size)
for(int i = oldSize; i < Size(); i++) for(int i = oldSize; i < Size(); i++)
{ {
if(BufferBlockSize > 0) if(BufferBlockSize > 0)
SoundBuffer[i] = (u8 *)MEM2_memalign(32, BufferBlockSize); SoundBuffer[i] = (u8 *)MEM1_memalign(32, BufferBlockSize);
else else
SoundBuffer[i] = NULL; SoundBuffer[i] = NULL;
BufferSize[i] = 0; BufferSize[i] = 0;
@ -87,7 +87,7 @@ void BufferCircle::RemoveBuffer(int pos)
return; return;
if(SoundBuffer[pos] != NULL) if(SoundBuffer[pos] != NULL)
MEM2_free(SoundBuffer[pos]); MEM1_free(SoundBuffer[pos]);
SoundBuffer.erase(SoundBuffer.begin()+pos); SoundBuffer.erase(SoundBuffer.begin()+pos);
BufferSize.erase(BufferSize.begin()+pos); BufferSize.erase(BufferSize.begin()+pos);
@ -109,7 +109,7 @@ void BufferCircle::FreeBuffer()
for(int i = 0; i < Size(); i++) for(int i = 0; i < Size(); i++)
{ {
if(SoundBuffer[i] != NULL) if(SoundBuffer[i] != NULL)
MEM2_free(SoundBuffer[i]); MEM1_free(SoundBuffer[i]);
BufferSize[i] = 0; BufferSize[i] = 0;
BufferReady[i] = false; BufferReady[i] = false;
} }

View File

@ -43,7 +43,7 @@ SoundHandler::SoundHandler()
for(u32 i = 0; i < MAX_DECODERS; ++i) for(u32 i = 0; i < MAX_DECODERS; ++i)
DecoderList[i] = NULL; DecoderList[i] = NULL;
ThreadStack = (u8 *)MEM2_memalign(32, 32768); ThreadStack = (u8 *)MEM1_memalign(32, 32768);
if(!ThreadStack) if(!ThreadStack)
return; return;
@ -61,7 +61,7 @@ SoundHandler::~SoundHandler()
SoundThread = LWP_THREAD_NULL; SoundThread = LWP_THREAD_NULL;
if(ThreadStack != NULL) if(ThreadStack != NULL)
{ {
MEM2_free(ThreadStack); MEM1_free(ThreadStack);
ThreadStack = NULL; ThreadStack = NULL;
} }