[rygel] mpris: Ignore read-only MPRIS intstances
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] mpris: Ignore read-only MPRIS intstances
- Date: Mon, 7 Oct 2013 15:17:05 +0000 (UTC)
commit 5eac952e69d06b7d650a8b1cd6403f63b222eca7
Author: Jens Georg <jensg openismus com>
Date: Mon Oct 7 17:16:22 2013 +0200
mpris: Ignore read-only MPRIS intstances
src/plugins/mpris/rygel-mpris-interfaces.vala | 1 +
src/plugins/mpris/rygel-mpris-plugin-factory.vala | 7 +++++++
2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/mpris/rygel-mpris-interfaces.vala b/src/plugins/mpris/rygel-mpris-interfaces.vala
index 7be0353..f56ebda 100644
--- a/src/plugins/mpris/rygel-mpris-interfaces.vala
+++ b/src/plugins/mpris/rygel-mpris-interfaces.vala
@@ -43,6 +43,7 @@ public interface Rygel.MPRIS.MediaPlayer.PlayerProxy : DBusProxy,
public abstract double volume { get; set; }
public abstract int64 position { get; }
public abstract bool can_seek { get; }
+ public abstract bool can_control { get; }
public abstract HashTable<string,Variant> metadata { owned get; }
public abstract void pause () throws DBusError;
diff --git a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
index 91c4714..cb5d098 100644
--- a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
@@ -127,6 +127,13 @@ public class Rygel.MPRIS.PluginFactory {
service_name,
MEDIA_PLAYER_PATH);
+ if (!player.can_control) {
+ message (_("MPRIS interface at %s is read-only. Ignoring."),
+ service_name);
+
+ return;
+ }
+
var plugin = new MPRIS.Plugin (service_name, player);
this.loader.add_plugin (plugin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]