Merge branch 'release-2.0' into develop

This commit is contained in:
Stein Magnus Jodal 2016-02-22 12:43:13 +01:00
commit 9c05cc8d05
2 changed files with 9 additions and 2 deletions

View File

@ -18,7 +18,10 @@ v2.0.1 (UNRELEASED)
Bug fix release.
- Nothing yet.
- Audio: Set ``soft-volume`` flag on GStreamer's playbin element. This is the
playbin's default, but we managed to override it when configuring the playbin
to only process audio. This should fix the "Volume/mute is not available"
warning.
v2.0.0 (2016-02-15)

View File

@ -21,6 +21,9 @@ logger = logging.getLogger(__name__)
# set_state() on a pipeline.
gst_logger = logging.getLogger('mopidy.audio.gst')
_GST_PLAY_FLAGS_AUDIO = 0x02
_GST_PLAY_FLAGS_SOFT_VOLUME = 0x10
_GST_STATE_MAPPING = {
Gst.State.PLAYING: PlaybackState.PLAYING,
Gst.State.PAUSED: PlaybackState.PAUSED,
@ -448,7 +451,8 @@ class Audio(pykka.ThreadingActor):
def _setup_playbin(self):
playbin = Gst.ElementFactory.make('playbin')
playbin.set_property('flags', 2) # GST_PLAY_FLAG_AUDIO
playbin.set_property(
'flags', _GST_PLAY_FLAGS_AUDIO | _GST_PLAY_FLAGS_SOFT_VOLUME)
# TODO: turn into config values...
playbin.set_property('buffer-size', 5 << 20) # 5MB