Fix 'not-negotiated' errors on some Spotify tracks (fixes #213)

This commit is contained in:
Stein Magnus Jodal 2012-10-24 22:35:36 +02:00
parent 587616ebf7
commit b53a82dbba
2 changed files with 25 additions and 0 deletions

View File

@ -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)
===================

View File

@ -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)