Fix incorrect selection when pressing back in subtitle dialog

This commit is contained in:
Neil Burrows 2021-06-12 16:30:32 +01:00
parent 2fd45dddc9
commit b4c09a6700
2 changed files with 3 additions and 3 deletions

View File

@ -382,7 +382,7 @@ function Main (args as Dynamic) as Void
node = m.scene.focusedChild
if node.isSubType("JFVideo") then
trackSelected = selectSubtitleTrack(node.Subtitles, node.SelectedSubtitle)
if trackSelected <> invalid then
if trackSelected <> invalid and trackSelected <> -2 then
changeSubtitleDuringPlayback(trackSelected)
end if
end if

View File

@ -2,8 +2,8 @@
function selectSubtitleTrack(tracks, current = -1) as integer
video = m.scene.focusedChild
trackSelected = selectSubtitleTrackDialog(video.Subtitles, video.SelectedSubtitle)
if trackSelected = invalid or trackSelected = -1 then
return invalid
if trackSelected = invalid or tackSelected = -1 then ' back pressed in Dialog - no selection made
return -2
else
return trackSelected - 1
end if