From e5e30cbf32a949973591252a94bceba1b8451832 Mon Sep 17 00:00:00 2001 From: dborth Date: Thu, 24 Jun 2010 18:07:10 +0000 Subject: [PATCH] fix sound, fix compiling on r22 --- SDL/src/audio/wii/SDL_wiiaudio.c | 12 +++++++----- smpeg/src/MPEGsystem.cpp | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/SDL/src/audio/wii/SDL_wiiaudio.c b/SDL/src/audio/wii/SDL_wiiaudio.c index 9adf202..c8d2615 100644 --- a/SDL/src/audio/wii/SDL_wiiaudio.c +++ b/SDL/src/audio/wii/SDL_wiiaudio.c @@ -40,6 +40,7 @@ static const char WIIAUD_DRIVER_NAME[] = "wii"; static Uint32 dma_buffers[2][SAMPLES_PER_DMA_BUFFER*8] __attribute__((aligned(32))); +static int dma_buffers_size[2] = { SAMPLES_PER_DMA_BUFFER*4, SAMPLES_PER_DMA_BUFFER*4 }; static Uint8 whichab = 0; #define AUDIOSTACK 16384*2 @@ -60,9 +61,6 @@ AudioThread (void *arg) if(stopaudio) break; - whichab ^= 1; - memset(dma_buffers[whichab], 0, sizeof(dma_buffers[0])); - // Is the device ready? if (current_audio && (!current_audio->paused)) { @@ -82,6 +80,8 @@ AudioThread (void *arg) // Copy from SDL buffer to DMA buffer memcpy(dma_buffers[whichab], current_audio->convert.buf, current_audio->convert.len_cvt); + DCFlushRange(dma_buffers[whichab], current_audio->convert.len_cvt); + dma_buffers_size[whichab] = current_audio->convert.len_cvt; } else { @@ -90,6 +90,8 @@ AudioThread (void *arg) current_audio->spec.userdata, (Uint8 *)dma_buffers[whichab], SAMPLES_PER_DMA_BUFFER*4); + DCFlushRange(dma_buffers[whichab], SAMPLES_PER_DMA_BUFFER*4); + dma_buffers_size[whichab] = SAMPLES_PER_DMA_BUFFER*4; SDL_mutexV(current_audio->mixer_lock); } } @@ -105,8 +107,8 @@ AudioThread (void *arg) static void DMACallback() { - DCFlushRange (dma_buffers[whichab], sizeof(dma_buffers[0])); - AUDIO_InitDMA ((Uint32)dma_buffers[whichab], SAMPLES_PER_DMA_BUFFER*4); + whichab ^= 1; + AUDIO_InitDMA ((Uint32)dma_buffers[whichab], dma_buffers_size[whichab]); LWP_ThreadSignal (audioqueue); } diff --git a/smpeg/src/MPEGsystem.cpp b/smpeg/src/MPEGsystem.cpp index cbd5a31..279518a 100644 --- a/smpeg/src/MPEGsystem.cpp +++ b/smpeg/src/MPEGsystem.cpp @@ -12,7 +12,7 @@ #include #include #ifndef __BEOS__ -#include +//#include #endif #endif