[rygel] core: Only set dlnaManaged flags if non-zero



commit 037f87be30337fbbaf3e57c578348938ccf4d3a5
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Nov 16 16:42:24 2010 +0200

    core: Only set dlnaManaged flags if non-zero
    
    Only set dlnaManaged flags if any of the contained flag is set. This is
    needed to comply with DLNA requirements 7.3.118.2-3.

 src/rygel/rygel-media-container.vala |    3 ++-
 src/rygel/rygel-media-item.vala      |    9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/rygel/rygel-media-container.vala b/src/rygel/rygel-media-container.vala
index b346f79..c2067c8 100644
--- a/src/rygel/rygel-media-container.vala
+++ b/src/rygel/rygel-media-container.vala
@@ -253,10 +253,11 @@ public abstract class Rygel.MediaContainer : MediaObject {
         didl_container.child_count = this.child_count;
         didl_container.upnp_class = this.upnp_class;
         didl_container.searchable = true;
-        didl_container.dlna_managed = this.ocm_flags;
 
         if (!this.restricted) {
             didl_container.restricted = false;
+            didl_container.dlna_managed = this.ocm_flags;
+
             var writable = this as WritableContainer;
             foreach (var create_class in writable.create_classes) {
                 didl_container.add_create_class (create_class);
diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala
index cde0b56..ae62463 100644
--- a/src/rygel/rygel-media-item.vala
+++ b/src/rygel/rygel-media-item.vala
@@ -191,8 +191,13 @@ public abstract class Rygel.MediaItem : MediaObject {
             didl_item.parent_id = "0";
         }
 
-        didl_item.restricted = this.restricted;
-        didl_item.dlna_managed = this.ocm_flags;
+        if (this.restricted) {
+            didl_item.restricted = true;
+        } else {
+            didl_item.restricted = false;
+            didl_item.dlna_managed = this.ocm_flags;
+        }
+
         didl_item.title = this.title;
         didl_item.upnp_class = this.upnp_class;
 



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