diff --git a/docs/changes.rst b/docs/changes.rst index bd90111e..5ab8ebd3 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -5,6 +5,27 @@ Changes This change log is used to track all major changes to Mopidy. +v0.8.1 (2012-10-30) +=================== + +A small maintenance release to fix a bug introduced in 0.8.0 and update Mopidy +to work with Pykka 1.0. + +**Dependencies** + +- Pykka >= 1.0 is now required. + +**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. + +- :issue:`216`: Volume returned by the MPD command `status` contained a + floating point ``.0`` suffix. This bug was introduced with the large audio + outout and mixer changes in v0.8.0. It now returns an integer again. + + v0.8.0 (2012-09-20) =================== diff --git a/docs/installation/gstreamer.rst b/docs/installation/gstreamer.rst index 42685ad0..38dbb86c 100644 --- a/docs/installation/gstreamer.rst +++ b/docs/installation/gstreamer.rst @@ -39,26 +39,11 @@ repository:: Installing GStreamer on OS X ============================ -.. note:: - - We have been working with `Homebrew `_ to - make all the GStreamer packages easily installable on OS X using Homebrew. - We've gotten most of our packages included, but the Homebrew guys aren't - very happy to include Python specific packages into Homebrew, even though - they are not installable by pip. If you're interested, see the discussion - in `Homebrew's issue #1612 - `_ for details. - -The following is currently the shortest path to installing GStreamer with -Python bindings on OS X using Homebrew. +We have been working with `Homebrew `_ for a +to make all the GStreamer packages easily installable on OS X. #. Install `Homebrew `_. -#. Download our Homebrew formula for ``gst-python``:: - - curl -o $(brew --prefix)/Library/Formula/gst-python.rb \ - https://raw.github.com/jodal/homebrew/gst-python/Library/Formula/gst-python.rb - #. Install the required packages:: brew install gst-python gst-plugins-good gst-plugins-ugly diff --git a/docs/installation/index.rst b/docs/installation/index.rst index 66b920f8..c58ba9dd 100644 --- a/docs/installation/index.rst +++ b/docs/installation/index.rst @@ -26,7 +26,7 @@ dependencies installed. - Python >= 2.6, < 3 - - Pykka >= 0.12.3:: + - Pykka >= 1.0:: sudo pip install -U pykka diff --git a/mopidy/__init__.py b/mopidy/__init__.py index 26e5b904..6436522e 100644 --- a/mopidy/__init__.py +++ b/mopidy/__init__.py @@ -1,6 +1,19 @@ +# pylint: disable = E0611,F0401 +from distutils.version import StrictVersion as SV +# pylint: enable = E0611,F0401 import sys + +import pykka + if not (2, 6) <= sys.version_info < (3,): - sys.exit(u'Mopidy requires Python >= 2.6, < 3') + sys.exit( + u'Mopidy requires Python >= 2.6, < 3, but found %s' % + '.'.join(map(str, sys.version_info[:3]))) + +if (isinstance(pykka.__version__, basestring) + and not SV('1.0') <= SV(pykka.__version__) < SV('2.0')): + sys.exit( + u'Mopidy requires Pykka >= 1.0, < 2, but found %s' % pykka.__version__) import os import platform @@ -8,7 +21,7 @@ from subprocess import PIPE, Popen import glib -__version__ = '0.8.0' +__version__ = '0.8.1' DATA_PATH = os.path.join(str(glib.get_user_data_dir()), 'mopidy') CACHE_PATH = os.path.join(str(glib.get_user_cache_dir()), 'mopidy') 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) diff --git a/mopidy/backends/dummy/__init__.py b/mopidy/backends/dummy/__init__.py index 3ada0052..8eb9029c 100644 --- a/mopidy/backends/dummy/__init__.py +++ b/mopidy/backends/dummy/__init__.py @@ -14,7 +14,7 @@ class DummyBackend(ThreadingActor, base.Backend): """ def __init__(self, *args, **kwargs): - super(DummyBackend, self).__init__(*args, **kwargs) + super(DummyBackend, self).__init__() self.current_playlist = core.CurrentPlaylistController(backend=self) diff --git a/mopidy/backends/local/__init__.py b/mopidy/backends/local/__init__.py index db86e56f..6488d97c 100644 --- a/mopidy/backends/local/__init__.py +++ b/mopidy/backends/local/__init__.py @@ -32,7 +32,7 @@ class LocalBackend(ThreadingActor, base.Backend): """ def __init__(self, *args, **kwargs): - super(LocalBackend, self).__init__(*args, **kwargs) + super(LocalBackend, self).__init__() self.current_playlist = core.CurrentPlaylistController(backend=self) diff --git a/mopidy/backends/spotify/__init__.py b/mopidy/backends/spotify/__init__.py index 1feb1c65..3811458d 100644 --- a/mopidy/backends/spotify/__init__.py +++ b/mopidy/backends/spotify/__init__.py @@ -47,7 +47,7 @@ class SpotifyBackend(ThreadingActor, base.Backend): from .playback import SpotifyPlaybackProvider from .stored_playlists import SpotifyStoredPlaylistsProvider - super(SpotifyBackend, self).__init__(*args, **kwargs) + super(SpotifyBackend, self).__init__() self.current_playlist = core.CurrentPlaylistController(backend=self) diff --git a/mopidy/utils/__init__.py b/mopidy/utils/__init__.py index aacc2e85..7d1a6dd6 100644 --- a/mopidy/utils/__init__.py +++ b/mopidy/utils/__init__.py @@ -24,7 +24,7 @@ def rescale(v, old=None, new=None): new_min, new_max = new old_min, old_max = old scaling = float(new_max - new_min) / (old_max - old_min) - return round(scaling * (v - old_min) + new_min) + return int(round(scaling * (v - old_min) + new_min)) def import_module(name): diff --git a/mopidy/utils/network.py b/mopidy/utils/network.py index 7d97daf8..ed81684e 100644 --- a/mopidy/utils/network.py +++ b/mopidy/utils/network.py @@ -250,7 +250,7 @@ class Connection(object): return True try: - self.actor_ref.send_one_way({'received': data}) + self.actor_ref.tell({'received': data}) except ActorDeadError: self.stop(u'Actor is dead.') diff --git a/requirements/core.txt b/requirements/core.txt index 8f9da622..7f83e251 100644 --- a/requirements/core.txt +++ b/requirements/core.txt @@ -1 +1 @@ -Pykka >= 0.12.3 +Pykka >= 1.0 diff --git a/tests/utils/network/connection_test.py b/tests/utils/network/connection_test.py index 96ddb833..0ca86a7f 100644 --- a/tests/utils/network/connection_test.py +++ b/tests/utils/network/connection_test.py @@ -383,14 +383,14 @@ class ConnectionTest(unittest.TestCase): self.assertTrue(network.Connection.recv_callback( self.mock, sentinel.fd, gobject.IO_IN)) - self.mock.actor_ref.send_one_way.assert_called_once_with( + self.mock.actor_ref.tell.assert_called_once_with( {'received': 'data'}) def test_recv_callback_handles_dead_actors(self): self.mock.sock = Mock(spec=socket.SocketType) self.mock.sock.recv.return_value = 'data' self.mock.actor_ref = Mock() - self.mock.actor_ref.send_one_way.side_effect = pykka.ActorDeadError() + self.mock.actor_ref.tell.side_effect = pykka.ActorDeadError() self.assertTrue(network.Connection.recv_callback( self.mock, sentinel.fd, gobject.IO_IN)) diff --git a/tests/version_test.py b/tests/version_test.py index c3eb00c1..0608a143 100644 --- a/tests/version_test.py +++ b/tests/version_test.py @@ -28,8 +28,9 @@ class VersionTest(unittest.TestCase): self.assert_(SV('0.7.0') < SV('0.7.1')) self.assert_(SV('0.7.1') < SV('0.7.2')) self.assert_(SV('0.7.2') < SV('0.7.3')) - self.assert_(SV('0.7.3') < SV(__version__)) - self.assert_(SV(__version__) < SV('0.8.1')) + self.assert_(SV('0.7.3') < SV('0.8.0')) + self.assert_(SV('0.8.0') < SV(__version__)) + self.assert_(SV(__version__) < SV('0.8.2')) def test_get_platform_contains_platform(self): self.assertIn(platform.platform(), get_platform())