From 36fadac7506a1fdb8f5b8d20e28e6977da7bbea7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 Jun 2017 16:48:04 +0200 Subject: ring: use 64 bit counters Apparently, this messes up on wraparound (although it shouldn't). After 2^32 bytes an audio "blip" happens with AOs that use this ringbuffer. Whatever, we can fix this by switching to a 64 bit counter. There's also a good chance the ringbuffer will be dropped completely, so don't waste more time on this. --- misc/ring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'misc/ring.c') diff --git a/misc/ring.c b/misc/ring.c index d72083475d..3262fc1cd6 100644 --- a/misc/ring.c +++ b/misc/ring.c @@ -30,15 +30,15 @@ struct mp_ring { /* Positions of the first readable/writeable chunks. Do not read this * fields but use the atomic private accessors `mp_ring_get_wpos` * and `mp_ring_get_rpos`. */ - atomic_ulong rpos, wpos; + atomic_ullong rpos, wpos; }; -static unsigned long mp_ring_get_wpos(struct mp_ring *buffer) +static unsigned long long mp_ring_get_wpos(struct mp_ring *buffer) { return atomic_load(&buffer->wpos); } -static unsigned long mp_ring_get_rpos(struct mp_ring *buffer) +static unsigned long long mp_ring_get_rpos(struct mp_ring *buffer) { return atomic_load(&buffer->rpos); } -- cgit v1.2.3