Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2008-07-17 21:03:08 (GMT)
committer Daniel Drake <dsd@laptop.org>2008-07-30 14:22:36 (GMT)
commite39226288e3291e96e9cdcf72222e4bcf7983fe0 (patch)
tree069f20a8adbbf6ab21ffed5cece3d989ec03f20d /common
parent8ae08dc97457d66b760841c00a45189ec1420896 (diff)
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?
Diffstat (limited to 'common')
-rwxr-xr-xcommon/Util/Clooper/aclient.sobin57129 -> 57513 bytes
-rw-r--r--common/Util/Clooper/audio.cpp12
2 files changed, 10 insertions, 2 deletions
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)
{