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.
This commit is contained in:
Thomas Adamcik 2014-08-03 23:54:56 +02:00
parent b8a0ca59cd
commit 6b88b4f685

View File

@ -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)