Date: Fri, 12 Dec 2003 11:51:21 +0900
From: Hayashi Naoyuki Subject: Tru64 audio(mme) fix ./src/audio/mme/SDL_mmeaudio.c Fix the sound skip problem which is caused even if it recover from high load. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40756
This commit is contained in:
parent
c1d69dc26c
commit
e3821f686a
1 changed files with 11 additions and 9 deletions
|
@ -191,17 +191,16 @@ static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec)
|
||||||
|
|
||||||
static void MME_WaitAudio(_THIS)
|
static void MME_WaitAudio(_THIS)
|
||||||
{
|
{
|
||||||
mmeWaitForCallbacks ();
|
while ( inUse[next_buffer] ) {
|
||||||
mmeProcessCallbacks ();
|
mmeWaitForCallbacks();
|
||||||
|
mmeProcessCallbacks();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Uint8 *MME_GetAudioBuf(_THIS)
|
static Uint8 *MME_GetAudioBuf(_THIS)
|
||||||
{
|
{
|
||||||
Uint8 *retval;
|
Uint8 *retval;
|
||||||
|
|
||||||
while ( inUse[next_buffer] )
|
|
||||||
;
|
|
||||||
|
|
||||||
inUse[next_buffer] = TRUE;
|
inUse[next_buffer] = TRUE;
|
||||||
retval = (Uint8 *)(shm->wHdr[next_buffer].lpData);
|
retval = (Uint8 *)(shm->wHdr[next_buffer].lpData);
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -220,13 +219,15 @@ static void MME_WaitDone(_THIS)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ( shm->sound ) {
|
if ( shm->sound ) {
|
||||||
|
for (i = 0; i < NUM_BUFFERS; i++)
|
||||||
|
while ( inUse[i] ) {
|
||||||
|
mmeWaitForCallbacks();
|
||||||
|
mmeProcessCallbacks();
|
||||||
|
}
|
||||||
result = waveOutReset(shm->sound);
|
result = waveOutReset(shm->sound);
|
||||||
if ( result != MMSYSERR_NOERROR )
|
if ( result != MMSYSERR_NOERROR )
|
||||||
SetMMerror("waveOutReset()", result);
|
SetMMerror("waveOutReset()", result);
|
||||||
else {
|
mmeProcessCallbacks();
|
||||||
mmeWaitForCallbacks ();
|
|
||||||
mmeProcessCallbacks ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,6 +247,7 @@ static void MME_CloseAudio(_THIS)
|
||||||
result = waveOutClose(shm->sound);
|
result = waveOutClose(shm->sound);
|
||||||
if (result != MMSYSERR_NOERROR )
|
if (result != MMSYSERR_NOERROR )
|
||||||
SetMMerror("waveOutClose()", result);
|
SetMMerror("waveOutClose()", result);
|
||||||
|
mmeProcessCallbacks();
|
||||||
}
|
}
|
||||||
result = mmeFreeMem(shm);
|
result = mmeFreeMem(shm);
|
||||||
if (result != MMSYSERR_NOERROR )
|
if (result != MMSYSERR_NOERROR )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue