]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
vss: Mmap audio files using MAP_POPULATE.
authorAndre Noll <maan@systemlinux.org>
Mon, 26 Sep 2011 06:27:18 +0000 (08:27 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 26 Sep 2011 06:27:18 +0000 (08:27 +0200)
This fixes buffer underruns on an old laptop containing a
slow IDE disk. The problem was that getting the next chunk
from the map sometimes hit the disk and took more than 300ms.

This patch adds MAP_POPULATE to the flags for mmap() to
turn on read-ahead for the mapping. This almost fixed the
problem, but some buffer underruns remained. Moreover,
MAP_POPULATE is only available on Linux. To fix also the
remaining cases, we now read one byte from each of the next
few pages in the map after a chunk has been sent. This way
the next chunk should already be cached when it is needed.


No differences found