From 14a3f2cbaff8604f2e5d52cf5cc68bd19f7abca8 Mon Sep 17 00:00:00 2001 From: FrederikTheDane <13228251+FrederikTheDane@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:52:27 +0200 Subject: [PATCH 1/2] fix: ffmpeg terminated prematurely When streaming audio from a pipe ffmpeg is no longer terminated prematurely which caused audio to cut out --- discord/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/player.py b/discord/player.py index 87b0f5718a..0b4dc417c3 100644 --- a/discord/player.py +++ b/discord/player.py @@ -227,7 +227,7 @@ def _pipe_writer(self, source: io.BufferedIOBase) -> None: # arbitrarily large read size data = source.read(8192) if not data: - self._process.terminate() + self._stdin.close() return try: self._stdin.write(data) From 2d14c78f96a8c1fceae8937d09e60dd92ff7849e Mon Sep 17 00:00:00 2001 From: FrederikTheDane <13228251+FrederikTheDane@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:08:43 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7b286bce..da82e6a9e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -178,6 +178,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2192](https://github.com/Pycord-Development/pycord/pull/2192)) - Fixed `DMChannel.recipient` being `None` and consequently `User.dm_channel` also being `None`. ([#2219](https://github.com/Pycord-Development/pycord/pull/2219)) +- Fixed ffmpeg being terminated prematurely when piping audio stream. + ([#2240](https://github.com/Pycord-Development/pycord/pull/2240)) ## [2.4.1] - 2023-03-20