aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-07-18 18:46:56 -0400
committerRapptz <[email protected]>2017-07-18 18:46:56 -0400
commiteda903f6b15bb954f519539b2cd4900ebb5c5a74 (patch)
tree45ee02ed409af0d8060c443ef11fdcc9558fa472
parent[commands] Restart the StringView properly in Context.reinvoke. (diff)
downloaddiscord.py-eda903f6b15bb954f519539b2cd4900ebb5c5a74.tar.xz
discord.py-eda903f6b15bb954f519539b2cd4900ebb5c5a74.zip
Add some logging for when ffmpeg processes get terminated.
-rw-r--r--discord/player.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/player.py b/discord/player.py
index 2565cdb9..17056e9c 100644
--- a/discord/player.py
+++ b/discord/player.py
@@ -169,9 +169,15 @@ class FFmpegPCMAudio(AudioSource):
def cleanup(self):
proc = self._process
+
+ log.info('Preparing to terminate ffmpeg process %s.', proc.pid)
proc.kill()
if proc.poll() is None:
+ log.info('ffmpeg process %s has not terminated. Waiting to terminate...', proc.pid)
proc.communicate()
+ log.info('ffmpeg process %s should have terminated with a return code of %s.', proc.pid, proc.returncode)
+ else:
+ log.info('ffmpeg process %s successfully terminated with return code of %s.', proc.pid, proc.returncode)
class PCMVolumeTransformer(AudioSource):
"""Transforms a previous :class:`AudioSource` to have volume controls.
@@ -281,8 +287,8 @@ class AudioPlayer(threading.Thread):
self._current_error = e
self.stop()
finally:
- self._call_after()
self.source.cleanup()
+ self._call_after()
def _call_after(self):
if self.after is not None: