aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pcm.c b/src/pcm.c
index e6f3b48..474295a 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1259,7 +1259,7 @@ static int pcm_mmap_transfer_areas(struct pcm *pcm, char *buf,
int commit;
unsigned int pcm_offset, frames, count = 0;
- while (size > 0) {
+ while (pcm_mmap_avail(pcm) && size) {
frames = size;
pcm_mmap_begin(pcm, &pcm_areas, &pcm_offset, &frames);
pcm_areas_copy(pcm, pcm_offset, buf, offset, frames);