From e39226288e3291e96e9cdcf72222e4bcf7983fe0 Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Thu, 17 Jul 2008 21:03:08 +0000 Subject: Loop until all sound frames are written This solves the audio-dropping-out bug, but I'm not sure if it is correct. Should we need to loop or not? --- (limited to 'common') diff --git a/common/Util/Clooper/aclient.so b/common/Util/Clooper/aclient.so index ca76f30..60f6048 100755 --- a/common/Util/Clooper/aclient.so +++ b/common/Util/Clooper/aclient.so Binary files differ diff --git a/common/Util/Clooper/audio.cpp b/common/Util/Clooper/audio.cpp index fea9c73..9fdbbce 100644 --- a/common/Util/Clooper/audio.cpp +++ b/common/Util/Clooper/audio.cpp @@ -195,8 +195,16 @@ open_error: return -1; } int err; - err = snd_pcm_writei (phandle, frame_data, frame_count ); - if (err == (signed)frame_count) return 0; //success + while (frame_count > 0) { + err = snd_pcm_writei (phandle, frame_data, frame_count ); + if (err == (signed)frame_count) return 0; //success + if (err == -EAGAIN) + continue; + if (err < 0) + break; + frame_data += err * 4; + frame_count -= err; + } if (err >= 0) { -- cgit v0.9.1