diff options
author | Ricardo Biehl Pasquali <pasqualirb@gmail.com> | 2018-12-18 23:24:19 -0200 |
---|---|---|
committer | Ricardo Biehl Pasquali <pasqualirb@gmail.com> | 2019-01-08 16:48:19 -0200 |
commit | 7aacaed904d237b2ae737a8bc8104101585446cb (patch) | |
tree | af2ac3f7ba35b654f9e326690c7396913947354b | |
parent | d759f4801789c6c83174a5eca474b59eda3e8090 (diff) |
pcm: Exit loop when there are no available frames
Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
-rw-r--r-- | src/pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |