Skip to content

Commit

Permalink
Merge pull request #103 from nununo/fix-stopping
Browse files Browse the repository at this point in the history
Fixed stop process: base player was kept running!
  • Loading branch information
tmontes authored Apr 25, 2018
2 parents 72aefae + 908e55a commit 9ac3d76
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions player/player_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def __init__(self, reactor, wiring, settings):
# keys/values: integer levels/list of OMXPlayer instances
self._players = collections.defaultdict(collections.deque)

# the player currently running, if not level 0
self._current_player = None
# the current level, once started
self._base_player = None
self._current_player = None # if not level 0
self._current_level = None

self._update_ld_lib_path()
Expand Down Expand Up @@ -133,8 +132,8 @@ def start(self):

yield self.dbus_mgr.connect_to_dbus(disconnect_callable=self._dbus_disconnected)

player = yield self._create_player(level=0)
yield player.play()
self._base_player = yield self._create_player(level=0)
yield self._base_player.play()
self._current_level = 0

yield self._create_players()
Expand Down Expand Up @@ -275,6 +274,11 @@ def stop(self, skip_dbus=False):
_log.info('stopping player level={l!r}', l=level)
yield players.popleft().stop(skip_dbus)
_log.info('stopped player level={l!r}', l=level)

_log.info('stopping base player')
yield self._base_player.fadeout_and_stop()
_log.info('stopped base player')

_log.info('cleaning up dbus manager')
yield self.dbus_mgr.cleanup()
_log.info('cleaned up dbus manager')
Expand Down

0 comments on commit 9ac3d76

Please sign in to comment.