From 6cb056c987eb9ec86e30bea615dbbb4683385409 Mon Sep 17 00:00:00 2001 From: A69Tor Date: Fri, 6 May 2016 16:24:23 -0400 Subject: [PATCH] Update playutils.py Add in videoprofile check and force transcode for Hi10P --- resources/lib/playutils.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 622781d2..7f5b6926 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -102,7 +102,12 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = settings('transcodeH265') + videoprofile = self.item['MediaSources'][1]['Name'] + transcodeHi10P = settings('transcodeHi10P') + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: + return False + if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution resolution = int(videotrack.split("P", 1)[0]) @@ -207,6 +212,11 @@ class PlayUtils(): videotrack = self.item['MediaSources'][0]['Name'] transcodeH265 = utils.settings('transcodeH265') + videoprofile = self.item['MediaSources'][1]['Name'] + transcodeHi10P = settings('transcodeHi10P') + + if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofile: + return False if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack): # Avoid H265/HEVC depending on the resolution @@ -423,4 +433,4 @@ class PlayUtils(): else: playurlprefs += "&AudioBitrate=192000" - return playurlprefs \ No newline at end of file + return playurlprefs