From 81b6620799311d08233d8eaa77ff6279d1ff8388 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sat, 5 Jan 2013 17:37:16 +0100 Subject: [PATCH] audio: Handle about to finish for non appsrc playback The appsrc cleanup code was still short circuiting the about to finish handler, this meant that EOT handling never happened for local files and playback stopped. With this change proper EOT handling works for all track types. --- mopidy/audio/actor.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 701fe2ac..f812d49f 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -82,13 +82,14 @@ class Audio(pykka.ThreadingActor): 'notify::source', self._on_new_source) def _on_about_to_finish(self, element): - source, self._appsrc = self._appsrc, None - if source is None: - return + # Cleanup appsrc related stuff. + old_appsrc, self._appsrc = self._appsrc, None + + if self._appsrc_seek_data_id is not None and old_appsrc: + old_appsrc.disconnect(self._appsrc_seek_data_id) + self._appsrc_caps = None - if self._appsrc_seek_data_id is not None: - source.disconnect(self._appsrc_seek_data_id) - self._appsrc_seek_data_id = None + self._appsrc_seek_data_id = None # TODO: this is just a horrible hack to get us started. the # comunication is correct, but this way of hooking it up is not.