From 5eeec20a75af773766ab15721cac1985fbddee60 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 18 Apr 2017 11:26:30 -0700 Subject: [PATCH] Fix overflowing timestamp in voice player This would cause heavy packet loss once our timestamp reached the int max. --- disco/voice/player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/disco/voice/player.py b/disco/voice/player.py index 9abe075..bc1add2 100644 --- a/disco/voice/player.py +++ b/disco/voice/player.py @@ -7,6 +7,8 @@ from holster.emitter import Emitter from disco.voice.client import VoiceState +MAX_TIMESTAMP = 4294967295 + class Player(object): Events = Enum( @@ -93,6 +95,8 @@ class Player(object): self.client.send_frame(frame) self.client.timestamp += item.samples_per_frame + if self.client.timestamp > MAX_TIMESTAMP: + self.client.timestamp = 0 frame = item.next_frame() if frame is None: