Skip to content

Commit

Permalink
Fix error dialog not showing when playback fails
Browse files Browse the repository at this point in the history
Timed updates were hanging when the player isn't ready.

Closes #153
  • Loading branch information
otsaloma committed Dec 27, 2020
1 parent 89d1a45 commit f786095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ Gaupol 1.9

* [x] Add framerates 30, 50, 59.94 and 60 fps (#164)
* [x] Allow shifting positions of all open projects (#66)
* [x] Fix error dialog when video playback fails (#153)
* [x] Fix the order of audio tracks in the menu (#129, qnga)
* [x] Fix spell-check split words correction task to not hang (#171)
3 changes: 3 additions & 0 deletions gaupol/agents/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def _on_player_state_changed(self, player, state):

def _on_player_update_seekbar(self, data=None):
"""Update seekbar from video position."""
if not self.player.ready: return
duration = self.player.get_duration(mode=None)
position = self.player.get_position(mode=None)
if duration is not None and position is not None:
Expand All @@ -235,6 +236,7 @@ def _on_player_update_seekbar(self, data=None):

def _on_player_update_subtitle(self, data=None):
"""Update subtitle overlay from video position."""
if not self.player.ready: return
pos = self.player.get_position(aeidon.modes.SECONDS)
if pos is None:
return True # to be called again.
Expand All @@ -250,6 +252,7 @@ def _on_player_update_subtitle(self, data=None):

def _on_player_update_volume(self, data=None):
"""Update volume from player."""
if not self.player.ready: return
self.volume_button.set_value(self.player.volume)
return True # to be called again.

Expand Down

0 comments on commit f786095

Please sign in to comment.