there!
This commit is contained in:
parent
78f29f784c
commit
2bfdd07d6c
|
@ -62,10 +62,11 @@ AudioThread (void *arg)
|
|||
break;
|
||||
|
||||
// Is the device ready?
|
||||
if (current_audio && (!current_audio->paused))
|
||||
if (!current_audio || current_audio->paused)
|
||||
{
|
||||
// Is conversion required?
|
||||
if (current_audio->convert.needed)
|
||||
memset(dma_buffers[whichab], 0, sizeof(dma_buffers[0]));
|
||||
}
|
||||
else if (current_audio->convert.needed) // Is conversion required?
|
||||
{
|
||||
SDL_mutexP(current_audio->mixer_lock);
|
||||
// Get the client to produce audio
|
||||
|
@ -79,7 +80,6 @@ AudioThread (void *arg)
|
|||
SDL_ConvertAudio(¤t_audio->convert);
|
||||
|
||||
// Copy from SDL buffer to DMA buffer
|
||||
memset(dma_buffers[whichab], 0, sizeof(dma_buffers[0]));
|
||||
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;
|
||||
|
@ -95,7 +95,6 @@ AudioThread (void *arg)
|
|||
dma_buffers_size[whichab] = SAMPLES_PER_DMA_BUFFER*4;
|
||||
SDL_mutexV(current_audio->mixer_lock);
|
||||
}
|
||||
}
|
||||
LWP_ThreadSleep (audioqueue);
|
||||
}
|
||||
return NULL;
|
||||
|
|
Reference in a new issue