volume: Suppress a critical warning

gvc_mixer_stream_get_port() emits a warning in the no-ports case,
which we can avoid by rearranging the check for that case.

https://bugzilla.gnome.org/show_bug.cgi?id=693049
This commit is contained in:
Florian Müllner 2013-02-01 20:19:02 +01:00
parent 9bcce4f271
commit d07c8dcd9c

View File

@ -169,9 +169,8 @@ const OutputStreamSlider = new Lang.Class({
// a bit hackish, but ALSA/PulseAudio have a number // a bit hackish, but ALSA/PulseAudio have a number
// of different identifiers for headphones, and I could // of different identifiers for headphones, and I could
// not find the complete list // not find the complete list
let port = sink.get_port(); if (sink.get_ports().length > 0)
if (port) return sink.get_port().port.indexOf('headphone') >= 0;
return port.port.indexOf('headphone') >= 0;
return false; return false;
}, },