diff options
author | Daniel Drake <dsd@laptop.org> | 2008-07-17 21:03:08 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2008-07-30 14:22:36 (GMT) |
commit | e39226288e3291e96e9cdcf72222e4bcf7983fe0 (patch) | |
tree | 069f20a8adbbf6ab21ffed5cece3d989ec03f20d | |
parent | 8ae08dc97457d66b760841c00a45189ec1420896 (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?
-rwxr-xr-x | common/Util/Clooper/aclient.so | bin | 57129 -> 57513 bytes | |||
-rw-r--r-- | common/Util/Clooper/audio.cpp | 12 |
2 files changed, 10 insertions, 2 deletions
diff --git a/common/Util/Clooper/aclient.so b/common/Util/Clooper/aclient.so Binary files differindex ca76f30..60f6048 100755 --- a/common/Util/Clooper/aclient.so +++ b/common/Util/Clooper/aclient.so 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) { |