Add some logging for when ffmpeg processes get terminated.
This commit is contained in:
parent
bd4505fec5
commit
eda903f6b1
@ -169,9 +169,15 @@ class FFmpegPCMAudio(AudioSource):
|
|||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
proc = self._process
|
proc = self._process
|
||||||
|
|
||||||
|
log.info('Preparing to terminate ffmpeg process %s.', proc.pid)
|
||||||
proc.kill()
|
proc.kill()
|
||||||
if proc.poll() is None:
|
if proc.poll() is None:
|
||||||
|
log.info('ffmpeg process %s has not terminated. Waiting to terminate...', proc.pid)
|
||||||
proc.communicate()
|
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):
|
class PCMVolumeTransformer(AudioSource):
|
||||||
"""Transforms a previous :class:`AudioSource` to have volume controls.
|
"""Transforms a previous :class:`AudioSource` to have volume controls.
|
||||||
@ -281,8 +287,8 @@ class AudioPlayer(threading.Thread):
|
|||||||
self._current_error = e
|
self._current_error = e
|
||||||
self.stop()
|
self.stop()
|
||||||
finally:
|
finally:
|
||||||
self._call_after()
|
|
||||||
self.source.cleanup()
|
self.source.cleanup()
|
||||||
|
self._call_after()
|
||||||
|
|
||||||
def _call_after(self):
|
def _call_after(self):
|
||||||
if self.after is not None:
|
if self.after is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user