mpv-player/mpv — pull request #275 by wrl (2013-10-08 17:26:07+00:00)
Title: mp_ring: fix mp_ring_read_cb() when read wraps around

previously, `mp_ring_read_cb()` would allow reading past the end of the ringbuffer when `buffered > available`.
`mp_ring_read()` had logic for splitting the read into two, which I duplicated into `mp_ring_read_cb()`.

this fixes a bug in the ao_jack driver which resulted in bursts of noise occuring whenever the ringbuffer would wrap around.