audio: Fix AttributeError on shutdown (fix #985)
Given the right timings, there was possible to get a stack trace at shutdown if the audio actor was teared down first and a music delivery from libspotify/pyspotify called audio.push() after the teardown.
This commit is contained in:
parent
9f199b12ce
commit
a3b7c8d44f
@ -128,6 +128,9 @@ class _Appsrc(object):
|
||||
self._source = source
|
||||
|
||||
def push(self, buffer_):
|
||||
if self._source is None:
|
||||
return False
|
||||
|
||||
if buffer_ is None:
|
||||
gst_logger.debug('Sending appsrc end-of-stream event.')
|
||||
return self._source.emit('end-of-stream') == gst.FLOW_OK
|
||||
|
||||
Loading…
Reference in New Issue
Block a user