[rygel] server: Add TwoPlayer to V1 downgrades



commit a91d5b99390951b80f31cb93d1a96adbaaf5bdde
Author: Jens Georg <mail jensge org>
Date:   Sun Aug 12 20:45:14 2012 +0200

    server: Add TwoPlayer to V1 downgrades
    
    So that at least the server part will work in TwoPlayer. Also do a
    slight refactor of the default agent list.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=680742

 data/rygel.conf                         |    2 +-
 src/librygel-server/rygel-v1-hacks.vala |   37 ++++++++++++++++++------------
 2 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/data/rygel.conf b/data/rygel.conf
index f7d5f1b..01dfe1d 100644
--- a/data/rygel.conf
+++ b/data/rygel.conf
@@ -75,7 +75,7 @@ allow-deletion=true
 #              working with Rygel, please file a bug at
 #              https://bugzilla.gnome.org/enter_bug.cgi?product=Rygel&component=IOP
 #              so we can include it in future releases.
-#force-downgrade-for=Allegro-Software-WebClient;SEC_HHP;SEC HHP;Mediabolic-IMHTTP/1
+#force-downgrade-for=Allegro-Software-WebClient;SEC_HHP;SEC HHP;Mediabolic-IMHTTP/1;TwoPlayer
 
 # Plugin specific sections
 #
diff --git a/src/librygel-server/rygel-v1-hacks.vala b/src/librygel-server/rygel-v1-hacks.vala
index 3e1a6bc..95883b4 100644
--- a/src/librygel-server/rygel-v1-hacks.vala
+++ b/src/librygel-server/rygel-v1-hacks.vala
@@ -1,7 +1,9 @@
 /*
  * Copyright (C) 2011 Nokia Corporation.
+ * Copyright (C) 2012 Jens Georg.
  *
  * Author: Jens Georg <jensg openismus com>
+ *         Jens Georg <mail jensge org>
  *
  * This file is part of Rygel.
  *
@@ -29,9 +31,12 @@ using GUPnP;
  * required to be backwards-compatible.
  */
 internal class Rygel.V1Hacks : ClientHacks {
-    private const string DEFAULT_AGENT = ".*Allegro-Software-WebClient.*|" +
-                                         ".*SEC[_ ]HHP.*|" +
-                                         ".*Mediabolic-IMHTTP/1.*";
+    private const string[] AGENTS = { "Allegro-Software-WebClient",
+                                      "SEC HHP",
+                                      "SEC_HHP",
+                                      "Mediabolic-IMHTTP/1.",
+                                      "TwoPlayer" };
+
     private const string DMS = "urn:schemas-upnp-org:device:MediaServer";
     private const string DMS_V1 = DMS + ":1";
     private const string MATCHING_PATTERN = ".*%s.*";
@@ -53,21 +58,23 @@ internal class Rygel.V1Hacks : ClientHacks {
         }
 
         var config = MetaConfig.get_default ();
-        agent_pattern = DEFAULT_AGENT;
+        var raw_agents = AGENTS;
         try {
-            var raw_agents = config.get_string_list ("general",
-                                                     "force-downgrade-for");
-            var agents = new string[0];
-            foreach (var agent in raw_agents) {
-                agents += MATCHING_PATTERN.printf
-                                        (Regex.escape_string (agent));
-            }
-
-            if (agents.length > 0) {
-                agent_pattern = string.joinv ("|", agents);
-            }
+            raw_agents = config.get_string_list ("general",
+                                                 "force-downgrade-for").
+                                                 to_array ();
         } catch (Error error) {}
 
+        var agents = new string[0];
+        foreach (var agent in raw_agents) {
+            agents += MATCHING_PATTERN.printf
+                                    (Regex.escape_string (agent));
+        }
+
+        if (agents.length > 0) {
+            agent_pattern = string.joinv ("|", agents);
+        }
+
         debug ("V1 downgrade will be applied for devices matching %s",
                agent_pattern);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]