]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: handle negative values from snd_pcm_mmap_hw_avail
authorAlexander E. Patrakov <patrakov@gmail.com>
Sat, 13 Sep 2014 18:30:15 +0000 (00:30 +0600)
committerJaroslav Kysela <perex@perex.cz>
Sat, 13 Sep 2014 19:04:26 +0000 (21:04 +0200)
commit78c804fc9348e4c29f1c77dd4b6ad586393aa628
tree855961f084ac555c7d25df88915001512daa65cc
parent9a43dc15b2979ed6d8850b033b594fbef829c991
pcm: handle negative values from snd_pcm_mmap_hw_avail

Such negative values can happen when an underrun happens and xrun
detection is disabled. Another situation is if the device updated the
pointer before alsa-lib has a chance to detect the xrun.

The problem is that these negative values could propagate to the
snd_pcm_rewindable return value, where it is specified that negative
returns must be interpreted as error codes and not as negative amount of
samples.

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_hw.c
src/pcm/pcm_ioplug.c
src/pcm/pcm_local.h
src/pcm/pcm_plugin.c