Merge pull request #1127 from croneter/fix-subs

Fix regression: burn-in subtitles picking up the last user setting instead of the current one
This commit is contained in:
croneter 2020-02-23 17:21:37 +01:00 committed by GitHub
commit 21e9e460a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 14 deletions

View file

@ -89,6 +89,7 @@
- Improve PKC automatically connecting to local PMS - Improve PKC automatically connecting to local PMS
- Ensure that our only video transcoding target is h264 - Ensure that our only video transcoding target is h264
- Fix adjusted subtitle size not working when burning in subtitles - Fix adjusted subtitle size not working when burning in subtitles
- Fix regression: burn-in subtitles picking up the last user setting instead of the current one
version 2.10.12: version 2.10.12:
- versions 2.10.5-11 for everyone - versions 2.10.5-11 for everyone

View file

@ -4,6 +4,7 @@ version 2.11.0 (beta only):
- Improve PKC automatically connecting to local PMS - Improve PKC automatically connecting to local PMS
- Ensure that our only video transcoding target is h264 - Ensure that our only video transcoding target is h264
- Fix adjusted subtitle size not working when burning in subtitles - Fix adjusted subtitle size not working when burning in subtitles
- Fix regression: burn-in subtitles picking up the last user setting instead of the current one
version 2.10.12: version 2.10.12:
- versions 2.10.5-11 for everyone - versions 2.10.5-11 for everyone

View file

@ -451,6 +451,11 @@ def _conclude_playback(playqueue, pos):
LOG.debug('Concluding playback for playqueue position %s', pos) LOG.debug('Concluding playback for playqueue position %s', pos)
item = playqueue.items[pos] item = playqueue.items[pos]
api = API(item.xml) api = API(item.xml)
if api.mediastream_number() is None:
# E.g. user could choose between several media streams and cancelled
LOG.debug('Did not get a mediastream_number')
_ensure_resolve()
return
api.part = item.part or 0 api.part = item.part or 0
listitem = api.listitem(listitem=transfer.PKCListItem, resume=False) listitem = api.listitem(listitem=transfer.PKCListItem, resume=False)
set_playurl(api, item) set_playurl(api, item)
@ -464,6 +469,9 @@ def _conclude_playback(playqueue, pos):
elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM, elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM,
v.PLAYBACK_METHOD_TRANSCODE): v.PLAYBACK_METHOD_TRANSCODE):
audio_subtitle_prefs(api, listitem) audio_subtitle_prefs(api, listitem)
# Need to hit the PMS api again in order to get the selected
# burn-in subtitles set-up correctly
set_playurl(api, item)
transfer.send(listitem) transfer.send(listitem)
LOG.debug('Done concluding playback') LOG.debug('Done concluding playback')

View file

@ -19,9 +19,6 @@ CONVERSION_OK = 1001 # PMS can either direct stream or transcode
def set_playurl(api, item): def set_playurl(api, item):
if api.mediastream_number() is None:
# E.g. user could choose between several media streams and cancelled
return
item.playmethod = int(utils.settings('playType')) item.playmethod = int(utils.settings('playType'))
LOG.info('User chose playback method %s in PKC settings', LOG.info('User chose playback method %s in PKC settings',
v.EXPLICIT_PLAYBACK_METHOD[item.playmethod]) v.EXPLICIT_PLAYBACK_METHOD[item.playmethod])
@ -420,19 +417,21 @@ def audio_subtitle_prefs(api, listitem):
# Enable Kodi to switch autonomously to downloadable subtitles # Enable Kodi to switch autonomously to downloadable subtitles
if download_subs: if download_subs:
listitem.setSubtitles(download_subs) listitem.setSubtitles(download_subs)
select_subs_index = ''
if sub_num == 1: if sub_num == 1:
# Note: we DO need to tell the PMS that we DONT want any sub
# Otherwise, the PMS might pick-up the last one
LOG.debug('No subtitles to burn-in') LOG.debug('No subtitles to burn-in')
return else:
resp = utils.dialog('select', utils.lang(33014), subtitle_streams) resp = utils.dialog('select', utils.lang(33014), subtitle_streams)
if resp < 1: if resp < 1:
# User did not select a subtitle or backed out of the dialog # User did not select a subtitle or backed out of the dialog
LOG.debug('User chose to not burn-in any subtitles') LOG.debug('User chose to not burn-in any subtitles')
return else:
select_subs_index = subtitle_streams_list[resp - 1]
LOG.debug('User chose to burn-in subtitle %s: %s', LOG.debug('User chose to burn-in subtitle %s: %s',
select_subs_index, select_subs_index,
subtitle_streams[resp].decode('utf-8')) subtitle_streams[resp].decode('utf-8'))
select_subs_index = subtitle_streams_list[resp - 1]
# Now prep the PMS for our choice # Now prep the PMS for our choice
args = { args = {
'subtitleStreamID': select_subs_index, 'subtitleStreamID': select_subs_index,