From 6a62ae4c83b1a56e4dc47131cee8809023d52b69 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 8 Feb 2020 02:17:14 -0500 Subject: [PATCH] Revert "Remove bad workaround with stdout" This reverts commit 750461620ef7c9c39ee0678d72407b17cb153dcd. --- rffmpeg.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rffmpeg.py b/rffmpeg.py index 20fec35..a7561db 100755 --- a/rffmpeg.py +++ b/rffmpeg.py @@ -173,6 +173,14 @@ if all_args[0] == 'ffprobe': else: rffmpeg_command.append(config['ffmpeg_command']) +# Determine if "-version" is an argument; if so, we output stdout to stdout, +# otherwise we output it to stderr +# Weird workaround for something Jellyfin requires... +if '-version' in cli_ffmpeg_args: + stdout = sys.stdout +else: + stdout = sys.stderr + # Parse and re-quote the arguments for arg in cli_ffmpeg_args: if arg[0] != '-': @@ -192,7 +200,7 @@ p = subprocess.run(rffmpeg_command, universal_newlines=True, stdin=sys.stdin, stderr=sys.stderr, - stdout=sys.stdout) + stdout=stdout) ############################################################################### # Cleanup