On Sat, Oct 18, 2008 at 10:56:31PM +0200, Paul Davis wrote:
> if read_ptr > size then the math should result in the write space being
The only way to know is to verify all the possible cases in
jack_ringbuffer_write_space() and jack_ringbuffer_read_space(),
taking into account that the masking operation may not have
been applied at the time these are called, and that 'the other'
*_ptr could be >= size.
Note that this is *much* simpler in the C++ class that
I poster earlier - there are no conditions at all in
write_avail() or read_avail(). The essential difference
is that I don't mask the stored values of _nrd and _nwr
(the equivalents of read_ptr and write_ptr). This also
removes the ambiguity between an empty and full buffer.
The downside is that it depends on the user code acting
in the correct way (which seems reasonable).
Ciao,
--
FA
Laboratorio di Acustica ed Elettroacustica
Parma, Italia
Lascia la spina, cogli la rosa.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.