diff options
-rw-r--r-- | src/media/upnp/grl-upnp.c | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/src/media/upnp/grl-upnp.c b/src/media/upnp/grl-upnp.c index a8e990c..744fefb 100644 --- a/src/media/upnp/grl-upnp.c +++ b/src/media/upnp/grl-upnp.c @@ -925,7 +925,6 @@ gupnp_browse_cb (GUPnPServiceProxy *service, gchar *didl = NULL; guint returned = 0; guint matches = 0; - gboolean result; struct OperationSpec *os; GUPnPDIDLLiteParser *didl_parser; @@ -934,31 +933,23 @@ gupnp_browse_cb (GUPnPServiceProxy *service, os = (struct OperationSpec *) user_data; didl_parser = gupnp_didl_lite_parser_new (); - result = - gupnp_service_proxy_end_action (service, action, &error, - "Result", G_TYPE_STRING, &didl, - "NumberReturned", G_TYPE_UINT, &returned, - "TotalMatches", G_TYPE_UINT, &matches, - NULL); + gupnp_service_proxy_end_action (service, action, &error, + "Result", G_TYPE_STRING, &didl, + "NumberReturned", G_TYPE_UINT, &returned, + "TotalMatches", G_TYPE_UINT, &matches, + NULL); - if (!result) { - GRL_WARNING ("Operation (browse, search or query) failed"); - os->callback (os->source, os->operation_id, NULL, 0, os->user_data, error); + if (!didl || !returned) { + GRL_DEBUG ("Got no results"); + os->callback (os->source, os->operation_id, + NULL, 0, os->user_data, error? error: NULL); if (error) { - GRL_WARNING (" Reason: %s", error->message); g_error_free (error); } goto free_resources; } - if (!didl || !returned) { - GRL_DEBUG ("Got no results"); - os->callback (os->source, os->operation_id, NULL, 0, os->user_data, NULL); - - goto free_resources; - } - /* Use os->count to emit "remaining" information */ if (os->count > returned) { os->count = returned; @@ -1004,7 +995,6 @@ gupnp_metadata_cb (GUPnPServiceProxy *service, { GError *error = NULL; gchar *didl = NULL; - gboolean result; GrlMediaSourceMetadataSpec *ms; GUPnPDIDLLiteParser *didl_parser; @@ -1013,29 +1003,21 @@ gupnp_metadata_cb (GUPnPServiceProxy *service, ms = (GrlMediaSourceMetadataSpec *) user_data; didl_parser = gupnp_didl_lite_parser_new (); - result = - gupnp_service_proxy_end_action (service, action, &error, - "Result", G_TYPE_STRING, &didl, - NULL); + gupnp_service_proxy_end_action (service, action, &error, + "Result", G_TYPE_STRING, &didl, + NULL); - if (!result) { - GRL_WARNING ("Metadata operation failed"); - ms->callback (ms->source, ms->metadata_id, ms->media, ms->user_data, error); + if (!didl) { + GRL_DEBUG ("Got no metadata"); + ms->callback (ms->source, ms->metadata_id, + ms->media, ms->user_data, error? error: NULL); if (error) { - GRL_WARNING (" Reason: %s", error->message); g_error_free (error); } goto free_resources; } - if (!didl) { - GRL_DEBUG ("Got no metadata"); - ms->callback (ms->source, ms->metadata_id, ms->media, ms->user_data, NULL); - - goto free_resources; - } - g_signal_connect (G_OBJECT (didl_parser), "object-available", G_CALLBACK (gupnp_metadata_result_cb), |