From 8e4b01912741b7ac548b823b2f897854e96fb612 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Thu, 12 Feb 2015 23:33:01 +0100 Subject: [PATCH] audio: Update #886 workaround to work with new audio APIs --- mopidy/audio/actor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 4b47d539..133c8424 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -546,12 +546,16 @@ class Audio(pykka.ThreadingActor): # XXX: Hack to workaround issue on Mac OS X where volume level # does not persist between track changes. mopidy/mopidy#886 - current_volume = self.get_volume() + if self.mixer is not None: + current_volume = self.mixer.get_volume() + else: + current_volume = None self._tags = {} # TODO: add test for this somehow self._playbin.set_property('uri', uri) - self.set_volume(current_volume) + if self.mixer is not None and current_volume is not None: + self.mixer.set_volume(current_volume) def set_appsrc( self, caps, need_data=None, enough_data=None, seek_data=None):