[grilo-plugins] [upnp] Reuse current media for metadata()



commit 466c6ae8f5fe659d4278854ce96d50f5cbd13e78
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Mon May 24 09:56:02 2010 +0200

    [upnp] Reuse current media for metadata()
    
    When building a media from didl, if operation was metadata() actually we need
    to update current media, instead of building new one.

 src/upnp/grl-upnp.c |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/src/upnp/grl-upnp.c b/src/upnp/grl-upnp.c
index 0c1eba8..c98f3cb 100644
--- a/src/upnp/grl-upnp.c
+++ b/src/upnp/grl-upnp.c
@@ -832,30 +832,31 @@ build_media_from_didl (GrlMedia *content,
 
   if (content) {
     media = content;
-  }
+  } else {
 
 #ifdef GUPNPAV_OLD_VERSION
-  if (gupnp_didl_lite_object_is_container (didl_node)) {
+    if (gupnp_didl_lite_object_is_container (didl_node)) {
 #else
-  if (GUPNP_IS_DIDL_LITE_CONTAINER (didl_node)) {
+    if (GUPNP_IS_DIDL_LITE_CONTAINER (didl_node)) {
 #endif
 
-    media = grl_media_box_new ();
-  } else {
-    if (!media) {
-      class = gupnp_didl_lite_object_get_upnp_class (didl_node);
-      if (class) {
-	if (g_str_has_prefix (class, "object.item.audioItem")) {
-	  media = grl_media_audio_new ();
-	} else if (g_str_has_prefix (class, "object.item.videoItem")) {
-	  media = grl_media_video_new ();
-	} else if (g_str_has_prefix (class, "object.item.imageItem")) {
-	  media = grl_media_image_new ();
-	} else {
-	  media = grl_media_new ();
-	}
-      } else {
-	media = grl_media_new ();
+      media = grl_media_box_new ();
+    } else {
+      if (!media) {
+        class = gupnp_didl_lite_object_get_upnp_class (didl_node);
+        if (class) {
+          if (g_str_has_prefix (class, "object.item.audioItem")) {
+            media = grl_media_audio_new ();
+          } else if (g_str_has_prefix (class, "object.item.videoItem")) {
+            media = grl_media_video_new ();
+          } else if (g_str_has_prefix (class, "object.item.imageItem")) {
+            media = grl_media_image_new ();
+          } else {
+            media = grl_media_new ();
+          }
+        } else {
+          media = grl_media_new ();
+        }
       }
     }
   }



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