Skip to content

Commit

Permalink
Wait for the audio callback to drain before quitting.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 11, 2011
1 parent cf96051 commit 738e5a8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/sdltheoraplay.c
Expand Up @@ -268,6 +268,15 @@ static void playfile(const char *fname)
} // while
} // while

while (!quit)
{
SDL_LockAudio();
quit = (audio_queue == NULL);
SDL_UnlockAudio();
if (!quit)
SDL_Delay(100); // wait for final audio packets to play out.
} // while

if (initfailed)
printf("Initialization failed!\n");
else if (THEORAPLAY_decodingError(decoder))
Expand Down

0 comments on commit 738e5a8

Please sign in to comment.