Skip to content

Commit

Permalink
Date: Fri, 12 Dec 2003 11:51:21 +0900
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Dec 14, 2003
1 parent 2247eca commit 449da93
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/audio/mme/SDL_mmeaudio.c
Expand Up @@ -191,17 +191,16 @@ static int MME_OpenAudio(_THIS, SDL_AudioSpec *spec)

static void MME_WaitAudio(_THIS)
{
mmeWaitForCallbacks ();
mmeProcessCallbacks ();
while ( inUse[next_buffer] ) {
mmeWaitForCallbacks();
mmeProcessCallbacks();
}
}

static Uint8 *MME_GetAudioBuf(_THIS)
{
Uint8 *retval;

while ( inUse[next_buffer] )
;

inUse[next_buffer] = TRUE;
retval = (Uint8 *)(shm->wHdr[next_buffer].lpData);
return retval;
Expand All @@ -220,13 +219,15 @@ static void MME_WaitDone(_THIS)
int i;

if ( shm->sound ) {
for (i = 0; i < NUM_BUFFERS; i++)
while ( inUse[i] ) {
mmeWaitForCallbacks();
mmeProcessCallbacks();
}
result = waveOutReset(shm->sound);
if ( result != MMSYSERR_NOERROR )
SetMMerror("waveOutReset()", result);
else {
mmeWaitForCallbacks ();
mmeProcessCallbacks ();
}
mmeProcessCallbacks();
}
}

Expand All @@ -246,6 +247,7 @@ static void MME_CloseAudio(_THIS)
result = waveOutClose(shm->sound);
if (result != MMSYSERR_NOERROR )
SetMMerror("waveOutClose()", result);
mmeProcessCallbacks();
}
result = mmeFreeMem(shm);
if (result != MMSYSERR_NOERROR )
Expand Down

0 comments on commit 449da93

Please sign in to comment.