audio: Set initial volume on software mixer

This must be set after the audio actor has injected itself into the software
mixer, else it will have no effect on the GStreamer software mixer.

Fixes #791
This commit is contained in:
Stein Magnus Jodal 2014-07-25 12:35:01 +02:00
parent 6ed8132f76
commit e4b54426b4
2 changed files with 13 additions and 0 deletions

View File

@ -10,6 +10,11 @@ v0.19.2 (UNRELEASED)
Bug fix release.
**Audio**
- Make :confval:`audio/mixer_volume` work on the software mixer again. This
was broken with the mixer changes in 0.19.0. (Fixes: :issue:`791`)
**HTTP**
- When using Tornado 4.0, allow WebSocket requests from other hosts. (Fixes:

View File

@ -195,6 +195,14 @@ class Audio(pykka.ThreadingActor):
self._connect(self._playbin, 'notify::volume', self._on_mixer_change)
self._connect(self._playbin, 'notify::mute', self._on_mixer_change)
# The Mopidy startup procedure will set the initial volume of a mixer,
# but this happens before the audio actor is injected into the software
# mixer and has no effect. Thus, we need to set the initial volume
# again.
initial_volume = self._config['audio']['mixer_volume']
if initial_volume is not None:
self._mixer.set_volume(initial_volume)
def _on_mixer_change(self, element, gparamspec):
self._mixer.trigger_events_for_changed_values()