[grilo-plugins] upnp: Avoid warning on empty resolve result



commit a3b550b0d495ffe175e13589062dbc5a66fb7bd8
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jul 26 09:53:19 2013 +0200

    upnp: Avoid warning on empty resolve result
    
    Fix warning when browsing a Synology UPnP server which returns
    an empty DIDL.
    
    (grilo-test-ui-0.2:7898): Grilo-WARNING **: [upnp] grl-upnp.c:1151: Failed to parse DIDL result: Empty 
'DIDL-Lite' node in the DIDL-Lite
    XML: <DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" 
xmlns:sec="http://www.sec.co.kr/"; xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/"></DIDL-Lite>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704917

 src/upnp/grl-upnp.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/upnp/grl-upnp.c b/src/upnp/grl-upnp.c
index e937ef3..1b7f822 100644
--- a/src/upnp/grl-upnp.c
+++ b/src/upnp/grl-upnp.c
@@ -1125,6 +1125,7 @@ gupnp_resolve_cb (GUPnPServiceProxy *service,
 {
   GError *error = NULL;
   gchar *didl = NULL;
+  guint returned = 0;
   GrlSourceResolveSpec *rs;
   GUPnPDIDLLiteParser *didl_parser;
 
@@ -1135,11 +1136,12 @@ gupnp_resolve_cb (GUPnPServiceProxy *service,
 
   gupnp_service_proxy_end_action (service, action, &error,
                                   "Result", G_TYPE_STRING, &didl,
+                                  "NumberReturned", G_TYPE_UINT, &returned,
                                   NULL);
 
-  if (!didl) {
-    GRL_DEBUG ("Resolve operation failed");
-    rs->callback (rs->source, rs->operation_id, rs->media, rs->user_data, error);
+  if (!didl || !returned) {
+    GRL_DEBUG ("Got no results for resolve");
+    rs->callback (rs->source, rs->operation_id, rs->media, rs->user_data, error? error: NULL);
     if (error) {
       g_error_free (error);
     }


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