Consider several media streams if transcoding

This commit is contained in:
tomkat83 2016-09-08 15:33:06 +02:00
parent 64d151282d
commit 67ca52a93e

View file

@ -1184,6 +1184,7 @@ class API():
self.item = item self.item = item
# which media part in the XML response shall we look at? # which media part in the XML response shall we look at?
self.part = 0 self.part = 0
self.media = 0
self.server = window('pms_server') self.server = window('pms_server')
self.client = clientinfo.ClientInfo() self.client = clientinfo.ClientInfo()
@ -2198,6 +2199,7 @@ class API():
media = xbmcgui.Dialog().select('Select stream', dialoglist) media = xbmcgui.Dialog().select('Select stream', dialoglist)
else: else:
media = 0 media = 0
self.media = media
return media return media
def getTranscodeVideoPath(self, action, quality=None): def getTranscodeVideoPath(self, action, quality=None):
@ -2221,13 +2223,14 @@ class API():
TODO: mediaIndex TODO: mediaIndex
""" """
media_stream = self._getMedia()
if quality is None: if quality is None:
quality = {} quality = {}
xargs = self.client.getXArgsDeviceInfo() xargs = self.client.getXArgsDeviceInfo()
# For DirectPlay, path/key of PART is needed # For DirectPlay, path/key of PART is needed
# trailers are 'clip' with PMS xmls # trailers are 'clip' with PMS xmls
if action == "DirectStream": if action == "DirectStream":
path = self.item[self._getMedia()][self.part].attrib['key'] path = self.item[media_stream][self.part].attrib['key']
url = self.server + path url = self.server + path
# e.g. Trailers already feature an '?'! # e.g. Trailers already feature an '?'!
if '?' in url: if '?' in url:
@ -2246,7 +2249,7 @@ class API():
'session': self.client.getDeviceId(), 'session': self.client.getDeviceId(),
'fastSeek': 1, 'fastSeek': 1,
'path': path, 'path': path,
'mediaIndex': 0, # Probably refering to XML reply sheme 'mediaIndex': media_stream,
'partIndex': self.part, 'partIndex': self.part,
# 'copyts': 1, # 'copyts': 1,
# 'offset': 0, # Resume point # 'offset': 0, # Resume point