From 6425734d82018b6fdafc28b0182ec947a5b3836c Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Sat, 23 Dec 2000 16:46:17 +0000 Subject: [PATCH] Fixes to mmap size computing --- src/pcm/pcm_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c index 7e05a09a..5c11ce4b 100644 --- a/src/pcm/pcm_mmap.c +++ b/src/pcm/pcm_mmap.c @@ -271,7 +271,7 @@ int snd_pcm_mmap(snd_pcm_t *pcm) unsigned int c1; if (!i->addr) { char *ptr; - size_t size = i->first + i->step * pcm->buffer_size; + size_t size = i->first + i->step * (pcm->buffer_size - 1) + pcm->bits_per_sample; for (c1 = c + 1; c1 < pcm->channels; ++c1) { snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1]; size_t s; -- 2.47.3