aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhazhismel Kumykov <[email protected]>2016-03-24 22:05:04 -0400
committerRapptz <[email protected]>2016-03-25 18:32:02 -0400
commitf1736bc08f8f13d8b808d73e63a31f1a2d77d4a9 (patch)
tree7d36d096344f023d07b251fafab09b38068f951c
parentAdd missing created_at properties for other objects. (diff)
downloaddiscord.py-f1736bc08f8f13d8b808d73e63a31f1a2d77d4a9.tar.xz
discord.py-f1736bc08f8f13d8b808d73e63a31f1a2d77d4a9.zip
Move ffmpeg process cleanup to player thread
-rw-r--r--discord/voice_client.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 77c368a3..a6f08ffe 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -122,11 +122,13 @@ class ProcessPlayer(StreamPlayer):
client._connected, client.play_audio, after, **kwargs)
self.process = process
- def stop(self):
+ def run(self):
+ super().run()
+
self.process.kill()
if self.process.poll() is None:
- self.process.communicate(timeout=0.100)
- super().stop()
+ self.process.communicate()
+
class VoiceClient:
"""Represents a Discord voice connection.