From: Abramo Bagnara Date: Tue, 28 Nov 2000 22:48:35 +0000 (+0000) Subject: Fixed mmap size computation X-Git-Tag: v1.0.3~1071 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=ae549cf739a053be9fbcd4a2b5bb4b5e04bfed56;p=alsa-lib.git Fixed mmap size computation --- diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c index 1a754c72..cec3e194 100644 --- a/src/pcm/pcm_mmap.c +++ b/src/pcm/pcm_mmap.c @@ -290,7 +290,7 @@ int snd_pcm_mmap(snd_pcm_t *pcm) default: assert(0); } - s = i1->first + i1->step * pcm->buffer_size; + s = i1->first + i1->step * (pcm->buffer_size - 1) + pcm->bits_per_sample; if (s > size) size = s; }