From bd5173fae86d590e070e15e43d2189ebe4a0674d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 7 Jun 2008 01:54:46 +0000 Subject: [PATCH] fix snd_pcm_mmap_writei undocumented EAGAIN return value --- stepmania/src/arch/Sound/ALSA9Helpers.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stepmania/src/arch/Sound/ALSA9Helpers.cpp b/stepmania/src/arch/Sound/ALSA9Helpers.cpp index c7e50709a8..d2caa8ce99 100644 --- a/stepmania/src/arch/Sound/ALSA9Helpers.cpp +++ b/stepmania/src/arch/Sound/ALSA9Helpers.cpp @@ -335,7 +335,13 @@ bool Alsa9Buf::WaitUntilFramesCanBeFilled( int timeout_ms ) void Alsa9Buf::Write( const int16_t *buffer, int frames ) { /* We should be able to write it all. If we don't, treat it as an error. */ - int wrote = dsnd_pcm_mmap_writei( pcm, (const char *) buffer, frames ); + int wrote; + do + { + wrote = dsnd_pcm_mmap_writei( pcm, (const char *) buffer, frames ); + } + while( wrote == -EAGAIN ); + if( wrote < 0 ) { LOG->Trace( "RageSoundDriver_ALSA9::GetData: dsnd_pcm_mmap_writei: %s (%i)", dsnd_strerror(wrote), wrote );