summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-28 16:48:04 +0200
committerwm4 <wm4@nowhere>2017-06-28 18:43:14 +0200
commit36fadac7506a1fdb8f5b8d20e28e6977da7bbea7 (patch)
tree21ff7b2b15f6eca7658ba498e3d62536803d3a37 /misc
parentc5a82f729bd09745488ef96fa7c76307c41c0073 (diff)
downloadmpv-36fadac7506a1fdb8f5b8d20e28e6977da7bbea7.tar.bz2
mpv-36fadac7506a1fdb8f5b8d20e28e6977da7bbea7.tar.xz
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.
Diffstat (limited to 'misc')
-rw-r--r--misc/ring.c6
1 files changed, 3 insertions, 3 deletions
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);
}