Merge pull request #37 from ATor69/master

This commit is contained in:
angelblue05 2016-05-07 13:44:02 -05:00
commit cbabcc0215
3 changed files with 13 additions and 2 deletions

View file

@ -299,6 +299,7 @@
<string id="30534">Server messages</string>
<string id="30535">Generate a new device Id</string>
<string id="30536">Sync when screensaver is deactivated</string>
<string id="30537">Force Transcode Hi10P</string>
<!-- service add-on -->
<string id="33000">Welcome</string>

View file

@ -18,7 +18,6 @@ class PlayUtils():
def __init__(self, item):
self.item = item
self.clientInfo = clientinfo.ClientInfo()
self.addonName = self.clientInfo.getAddonName()
@ -102,6 +101,11 @@ class PlayUtils():
videotrack = self.item['MediaSources'][0]['Name']
transcodeH265 = settings('transcodeH265')
videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x]
transcodeHi10P = utils.settings('transcodeHi10P')
if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles:
return False
if transcodeH265 in ("1", "2", "3") and ("HEVC" in videotrack or "H265" in videotrack):
# Avoid H265/HEVC depending on the resolution
@ -207,6 +211,11 @@ class PlayUtils():
videotrack = self.item['MediaSources'][0]['Name']
transcodeH265 = utils.settings('transcodeH265')
videoprofiles = [x['Profile'] for x in self.item['MediaSources'][0]['MediaStreams'] if 'Profile' in x]
transcodeHi10P = utils.settings('transcodeHi10P')
if transcodeHi10P == "true" and "H264" in videotrack and "High 10" in videoprofiles:
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 +432,4 @@ class PlayUtils():
else:
playurlprefs += "&AudioBitrate=192000"
return playurlprefs
return playurlprefs

View file

@ -55,6 +55,7 @@
<setting id="playFromStream" type="bool" label="30002" default="false" />
<setting id="videoBitrate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" visible="true" default="17" subsetting="true" />
<setting id="transcodeH265" type="enum" label="30522" default="0" values="Disabled|480p(and higher)|720p(and higher)|1080p" />
<setting id="transcodeHi10P" type="bool" label="30537" default="false"/>
<setting id="markPlayed" type="number" visible="false" default="90" />
<setting id="failedCount" type="number" visible="false" default="0" />
<setting id="networkCreds" type="text" visible="false" default="" />