Merge pull request #511 from neilsb/subtitle-selection-fix

This commit is contained in:
Anthony Lavado 2021-12-23 18:52:02 -05:00 committed by GitHub
commit f66479d597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -265,7 +265,7 @@ sub Main (args as dynamic) as void
end if
else if isNodeEvent(msg, "selectSubtitlePressed")
node = m.scene.focusedChild
if node.isSubType("JFVideo")
if node.focusedChild <> invalid and node.focusedChild.isSubType("JFVideo")
trackSelected = selectSubtitleTrack(node.Subtitles, node.SelectedSubtitle)
if trackSelected <> invalid and trackSelected <> -2
changeSubtitleDuringPlayback(trackSelected)

View File

@ -1,6 +1,6 @@
function selectSubtitleTrack(tracks, current = -1) as integer
video = m.scene.focusedChild
video = m.scene.focusedChild.focusedChild
trackSelected = selectSubtitleTrackDialog(video.Subtitles, video.SelectedSubtitle)
if trackSelected = invalid or trackSelected = -1 ' back pressed in Dialog - no selection made
return -2
@ -37,7 +37,7 @@ sub changeSubtitleDuringPlayback(newid)
return
end if
video = m.scene.focusedChild
video = m.scene.focusedChild.focusedChild
' If no change of subtitle track, return
if newid = video.SelectedSubtitle then return
@ -74,7 +74,7 @@ sub changeSubtitleDuringPlayback(newid)
end sub
sub turnoffSubtitles()
video = m.scene.focusedChild
video = m.scene.focusedChild.focusedChild
current = video.SelectedSubtitle
video.SelectedSubtitle = -1
video.globalCaptionMode = "Off"