aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>2018-12-18 23:24:19 -0200
committerRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-08 16:48:19 -0200
commit7aacaed904d237b2ae737a8bc8104101585446cb (patch)
treeaf2ac3f7ba35b654f9e326690c7396913947354b
parentd759f4801789c6c83174a5eca474b59eda3e8090 (diff)
pcm: Exit loop when there are no available frames
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
-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);