audio: Set soft-volume flag on playbin
This commit is contained in:
parent
6107254cb0
commit
1e8bef25d3
@ -10,7 +10,10 @@ v2.0.1 (UNRELEASED)
|
|||||||
|
|
||||||
Bug fix release.
|
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)
|
v2.0.0 (2016-02-15)
|
||||||
|
|||||||
@ -21,6 +21,9 @@ logger = logging.getLogger(__name__)
|
|||||||
# set_state() on a pipeline.
|
# set_state() on a pipeline.
|
||||||
gst_logger = logging.getLogger('mopidy.audio.gst')
|
gst_logger = logging.getLogger('mopidy.audio.gst')
|
||||||
|
|
||||||
|
_GST_PLAY_FLAGS_AUDIO = 0x02
|
||||||
|
_GST_PLAY_FLAGS_SOFT_VOLUME = 0x10
|
||||||
|
|
||||||
_GST_STATE_MAPPING = {
|
_GST_STATE_MAPPING = {
|
||||||
Gst.State.PLAYING: PlaybackState.PLAYING,
|
Gst.State.PLAYING: PlaybackState.PLAYING,
|
||||||
Gst.State.PAUSED: PlaybackState.PAUSED,
|
Gst.State.PAUSED: PlaybackState.PAUSED,
|
||||||
@ -448,7 +451,8 @@ class Audio(pykka.ThreadingActor):
|
|||||||
|
|
||||||
def _setup_playbin(self):
|
def _setup_playbin(self):
|
||||||
playbin = Gst.ElementFactory.make('playbin')
|
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...
|
# TODO: turn into config values...
|
||||||
playbin.set_property('buffer-size', 5 << 20) # 5MB
|
playbin.set_property('buffer-size', 5 << 20) # 5MB
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user