audio: Going to NULL already handles the flushing for us
This commit is contained in:
parent
ccd3753b30
commit
cd579ff7bb
@ -47,7 +47,6 @@ class Scanner(object):
|
|||||||
self._pipe.add(sink)
|
self._pipe.add(sink)
|
||||||
|
|
||||||
self._bus = self._pipe.get_bus()
|
self._bus = self._pipe.get_bus()
|
||||||
self._bus.set_flushing(True)
|
|
||||||
|
|
||||||
def scan(self, uri):
|
def scan(self, uri):
|
||||||
"""
|
"""
|
||||||
@ -83,8 +82,6 @@ class Scanner(object):
|
|||||||
self._src.sync_state_with_parent()
|
self._src.sync_state_with_parent()
|
||||||
self._src.link(self._decodebin)
|
self._src.link(self._decodebin)
|
||||||
|
|
||||||
self._bus.set_flushing(False)
|
|
||||||
|
|
||||||
result = self._pipe.set_state(gst.STATE_PAUSED)
|
result = self._pipe.set_state(gst.STATE_PAUSED)
|
||||||
if result == gst.STATE_CHANGE_NO_PREROLL:
|
if result == gst.STATE_CHANGE_NO_PREROLL:
|
||||||
# Live sources don't pre-roll, so set to playing to get data.
|
# Live sources don't pre-roll, so set to playing to get data.
|
||||||
@ -121,8 +118,7 @@ class Scanner(object):
|
|||||||
raise exceptions.ScannerError('Timeout after %dms' % self._timeout_ms)
|
raise exceptions.ScannerError('Timeout after %dms' % self._timeout_ms)
|
||||||
|
|
||||||
def _reset(self):
|
def _reset(self):
|
||||||
"""Ensures we cleanup child elements and flush the bus."""
|
"""Ensures we cleanup child elements."""
|
||||||
self._bus.set_flushing(True)
|
|
||||||
self._pipe.set_state(gst.STATE_NULL)
|
self._pipe.set_state(gst.STATE_NULL)
|
||||||
self._src.unlink(self._decodebin)
|
self._src.unlink(self._decodebin)
|
||||||
self._pipe.remove(self._src)
|
self._pipe.remove(self._src)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user