diff --git a/docs/changes.rst b/docs/changes.rst index bd90111e..bea524e8 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -5,6 +5,16 @@ Changes This change log is used to track all major changes to Mopidy. +v0.8.1 (in development) +======================= + +**Bug fixes** + +- :issue:`213`: Fix "streaming task paused, reason not-negotiated" errors + observed by some users on some Spotify tracks due to a change introduced in + 0.8.0. See the issue for a patch that applies to 0.8.0. + + v0.8.0 (2012-09-20) =================== diff --git a/mopidy/audio/__init__.py b/mopidy/audio/__init__.py index df5efb92..d630a0f0 100644 --- a/mopidy/audio/__init__.py +++ b/mopidy/audio/__init__.py @@ -70,6 +70,21 @@ class Audio(ThreadingActor): fakesink = gst.element_factory_make('fakesink') self._playbin.set_property('video-sink', fakesink) + self._playbin.connect('notify::source', self._on_new_source) + + def _on_new_source(self, element, pad): + uri = element.get_property('uri') + if not uri or not uri.startswith('appsrc://'): + return + + # These caps matches the audio data provided by libspotify + default_caps = gst.Caps( + 'audio/x-raw-int, endianness=(int)1234, channels=(int)2, ' + 'width=(int)16, depth=(int)16, signed=(boolean)true, ' + 'rate=(int)44100') + source = element.get_property('source') + source.set_property('caps', default_caps) + def _teardown_playbin(self): self._playbin.set_state(gst.STATE_NULL)