Skip to content

Commit

Permalink
Merge pull request #3 from ArchieMeng/matrix
Browse files Browse the repository at this point in the history
fix bug: crash on opening subtitles
  • Loading branch information
enen92 authored Mar 6, 2021
2 parents 575859c + 9b01e5a commit c7ad3f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/xbmcswift2/xbmcmixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,13 @@ def _add_subtitles(self, subtitles):
# this method.
player = xbmc.Player()
monitor = xbmc.Monitor()
for _ in range(30) and not monitor.abortRequested():
for _ in range(30):
if player.isPlaying():
break

if monitor.abortRequested():
return

monitor.waitForAbort(1)
else:
raise Exception('No video playing. Aborted after 30 seconds.')
Expand Down

0 comments on commit c7ad3f4

Please sign in to comment.