summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McNeil <sean.mcneil@windriver.com>2009-12-03 03:35:48 +0700
committerSean McNeil <sean.mcneil@windriver.com>2009-12-03 03:35:48 +0700
commit55c0a2979d070b56b3e10bd92a9fc9aa7b174246 (patch)
tree4e6de6260f11a3107bdff4e77c2eaada9e90fcea
parentb68de1db25598a54313ce4e7faf47d7af1c9c844 (diff)
downloadalsa_sound-55c0a2979d070b56b3e10bd92a9fc9aa7b174246.tar.gz
Write correct number of bytes per attempt.
-rw-r--r--AudioStreamOutALSA.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/AudioStreamOutALSA.cpp b/AudioStreamOutALSA.cpp
index b042bfb..8d19caa 100644
--- a/AudioStreamOutALSA.cpp
+++ b/AudioStreamOutALSA.cpp
@@ -90,7 +90,7 @@ ssize_t AudioStreamOutALSA::write(const void *buffer, size_t bytes)
do {
n = snd_pcm_writei(mHandle->handle,
(char *)buffer + sent,
- snd_pcm_bytes_to_frames(mHandle->handle, bytes));
+ snd_pcm_bytes_to_frames(mHandle->handle, bytes - sent));
if (n == -EBADFD) {
// Somehow the stream is in a bad state. The driver probably
// has a bug and snd_pcm_recover() doesn't seem to handle this.