diff options
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | src/media-player-mpris.vala | 4 | ||||
-rw-r--r-- | src/mpris2-interfaces.vala | 2 | ||||
-rw-r--r-- | src/volume-control-pulse.vala | 29 |
4 files changed, 27 insertions, 16 deletions
diff --git a/debian/changelog b/debian/changelog index 2f61475..c93ca20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +indicator-sound (12.10.2+15.04.20150403-0ubuntu1) vivid; urgency=medium + + [ Ted Gould ] + * Handle Vala incorrectly returning null for a non-null type (LP: + #1428711) + + -- CI Train Bot <ci-train-bot@canonical.com> Fri, 03 Apr 2015 14:52:02 +0000 + indicator-sound (12.10.2+15.04.20150311-0ubuntu1) vivid; urgency=medium [ Charles Kerr ] diff --git a/src/media-player-mpris.vala b/src/media-player-mpris.vala index bf25e21..741d887 100644 --- a/src/media-player-mpris.vala +++ b/src/media-player-mpris.vala @@ -202,7 +202,7 @@ public class MediaPlayerMpris: MediaPlayer { gproxy.g_properties_changed.connect (this.proxy_properties_changed); this.notify_property ("is-running"); - this.state = this.proxy.PlaybackStatus; + this.state = this.proxy.PlaybackStatus != null ? this.proxy.PlaybackStatus : "Unknown"; this.update_current_track (gproxy.get_cached_property ("Metadata")); if (this.play_when_attached) { @@ -270,7 +270,7 @@ public class MediaPlayerMpris: MediaPlayer { void proxy_properties_changed (DBusProxy proxy, Variant changed_properties, string[] invalidated_properties) { if (changed_properties.lookup ("PlaybackStatus", "s", null)) { - this.state = this.proxy.PlaybackStatus; + this.state = this.proxy.PlaybackStatus != null ? this.proxy.PlaybackStatus : "Unknown"; } var metadata = changed_properties.lookup_value ("Metadata", new VariantType ("a{sv}")); diff --git a/src/mpris2-interfaces.vala b/src/mpris2-interfaces.vala index cb68e84..a472d5c 100644 --- a/src/mpris2-interfaces.vala +++ b/src/mpris2-interfaces.vala @@ -37,7 +37,7 @@ public interface MprisPlayer : Object { // properties public abstract HashTable<string, Variant?> Metadata{owned get; set;} public abstract int32 Position{owned get; set;} - public abstract string PlaybackStatus{owned get; set;} + public abstract string? PlaybackStatus{owned get; set;} // methods public abstract async void PlayPause() throws IOError; public abstract async void Next() throws IOError; diff --git a/src/volume-control-pulse.vala b/src/volume-control-pulse.vala index 9ac7dce..050318b 100644 --- a/src/volume-control-pulse.vala +++ b/src/volume-control-pulse.vala @@ -616,23 +616,26 @@ public class VolumeControlPulse : VolumeControl return _volume; } set { - debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason); + if (value.volume != _volume.volume) { + debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason); - var old_high_volume = this.high_volume; - _volume = value; + var old_high_volume = this.high_volume; + _volume = value; - /* Make sure we're connected to Pulse and pulse didn't give us the change */ - if (context.get_state () == Context.State.READY && - _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE) - if (_pulse_use_stream_restore) - set_volume_active_role.begin (); - else - context.get_server_info (server_info_cb_for_set_volume); + /* Make sure we're connected to Pulse and pulse didn't give us the change */ + if (context.get_state () == Context.State.READY && + _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE) + if (_pulse_use_stream_restore) + set_volume_active_role.begin (); + else + context.get_server_info (server_info_cb_for_set_volume); - if (this.high_volume != old_high_volume) - this.notify_property("high-volume"); + if (this.high_volume != old_high_volume) + this.notify_property("high-volume"); - start_local_volume_timer(); + if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET) + start_local_volume_timer(); + } } } |