From 6b88b4f68539954974f02888403f29e650a43360 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sun, 3 Aug 2014 23:54:56 +0200 Subject: [PATCH] audio: Group playbin teardown/setup This makes it possible to see that we setup and teardown the same things. Also fixes disconnect on a signal we no longer listen to. --- mopidy/audio/actor.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 520ac41c..144a0b78 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -320,6 +320,11 @@ class Audio(pykka.ThreadingActor): self._playbin = playbin + def _teardown_playbin(self): + self._signals.disconnect(self._playbin, 'about-to-finish') + self._signals.disconnect(self._playbin, 'source-setup') + self._playbin.set_state(gst.STATE_NULL) + def _on_about_to_finish(self, element): gst_logger.debug('Got about-to-finish event.') if self._about_to_finish_callback: @@ -336,12 +341,6 @@ class Audio(pykka.ThreadingActor): if hasattr(source.props, 'proxy'): setup_proxy(source, self._config['proxy']) - def _teardown_playbin(self): - self._signals.disconnect(self._playbin, 'about-to-finish') - self._signals.disconnect(self._playbin, 'notify::source') - self._signals.disconnect(self._playbin, 'source-setup') - self._playbin.set_state(gst.STATE_NULL) - def _setup_output(self): self._outputs = _Outputs() self._outputs.get_pad('sink').add_event_probe(self._on_pad_event)