From 2a391f23e1a11b84de0a2bb665989e49b9a7129a Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Thu, 8 Nov 2012 23:17:48 +0100 Subject: [PATCH] Use source's factory name to determine type. Checking the URI inside the new-source handler turned out to tickle some issue that gave us deadlocks. Getting the source and checking which factory created it is much safer. --- mopidy/audio/actor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 7de98075..1f482301 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -78,8 +78,9 @@ class Audio(pykka.ThreadingActor): self._appsrc = None def _on_new_source(self, element, pad): - uri = element.get_property('uri') - if not uri or not uri.startswith('appsrc://'): + source = element.get_property('source') + + if source.get_factory().get_name() != 'appsrc': return # These caps matches the audio data provided by libspotify @@ -87,7 +88,6 @@ class Audio(pykka.ThreadingActor): b'audio/x-raw-int, endianness=(int)1234, channels=(int)2, ' b'width=(int)16, depth=(int)16, signed=(boolean)true, ' b'rate=(int)44100') - source = element.get_property('source') source.set_property('caps', default_caps) # GStreamer does not like unicode source.set_property('format', b'time')