Browse Source

Drop voice packets when it can be potentially blocking.

pull/145/head
Rapptz 9 years ago
parent
commit
ee4574a5e1
  1. 6
      discord/voice_client.py

6
discord/voice_client.py

@ -672,5 +672,9 @@ class VoiceClient:
else:
encoded_data = data
packet = self._get_voice_packet(encoded_data)
sent = self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
try:
sent = self.socket.sendto(packet, (self.endpoint_ip, self.voice_port))
except BlockingIOError:
log.warning('A packet has been dropped (seq: {0.sequence}, timestamp: {0.timestamp})'.format(self))
self.checked_add('timestamp', self.encoder.samples_per_frame, 4294967295)

Loading…
Cancel
Save