ao_alsa: Sanity check get_space() return values better
commitf01f7f6259badb2725be49af914d8db52e025cf6
authorUoti Urpala <uau@glyph.nonexistent.invalid>
Wed, 10 Dec 2008 00:47:38 +0000 (10 02:47 +0200)
committerUoti Urpala <uau@glyph.nonexistent.invalid>
Wed, 10 Dec 2008 00:54:01 +0000 (10 02:54 +0200)
tree0d9545588f4601bab9b3968e01073809cfc214b4
parent6fa90873ccc8006e479061afdd0edfbfdadf17ec
ao_alsa: Sanity check get_space() return values better

Sometimes after seek audio reset I see snd_pcm_status_get_avail()
return huge values. get_space() already had a check againt the value
being larger than the whole buffer; however since the unsigned value
from the ALSA function had been cast to signed by that point it was
interpreted as negative and the check didn't trigger. Use unsigned
instead to make the check reliable and ensure the return value is sane.
libao2/ao_alsa.c