]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: express the rewind size limitation logic better
authorAlexander E. Patrakov <patrakov@gmail.com>
Sat, 13 Sep 2014 18:30:14 +0000 (00:30 +0600)
committerJaroslav Kysela <perex@perex.cz>
Sat, 13 Sep 2014 19:04:13 +0000 (21:04 +0200)
commit9a43dc15b2979ed6d8850b033b594fbef829c991
treeadc811f4a1d6363af6e038e68da54d4adae04677
parent9a56a673a6cd7343a9345921e2b1cbbb43fb725f
pcm: express the rewind size limitation logic better

There are a few places where the argument of the .rewind or .forward
callback is checked against the same value as returned by .rewindable or
.forwardable. Express this "don't rewind more than rewindable" logic
explicitly, so that the future fixes to the rewindable size can go to
one function instead of two.

While at it, take advantage of the fact that snd_pcm_mmap_avail() cannot
return negative values (except due to integer overflow, which is AFAICS
impossible given the current boundary choice).

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_dmix.c
src/pcm/pcm_dshare.c
src/pcm/pcm_dsnoop.c
src/pcm/pcm_plugin.c