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.
This commit is contained in:
wm4 2017-06-28 16:48:04 +02:00
parent c5a82f729b
commit 36fadac750
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}