From 1e8bef25d36e1c257a369ff0ce5729c2939f384e Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 22 Feb 2016 12:42:56 +0100 Subject: [PATCH] audio: Set soft-volume flag on playbin --- docs/changelog.rst | 5 ++++- mopidy/audio/actor.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 73dad36d..dad0c741 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,7 +10,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) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 64300ff9..267b228d 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -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