From a3b7c8d44f8525350f83c84e7927f518a431922c Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Fri, 13 Feb 2015 09:33:05 +0100 Subject: [PATCH] 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. --- mopidy/audio/actor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 6ef48a6b..63b0eebe 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -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