diff -r 847da7267234 -r e612ba1d16ab gmyth-upnp/src/gmyth_upnp.c --- a/gmyth-upnp/src/gmyth_upnp.c Fri Feb 01 22:17:33 2008 +0000 +++ b/gmyth-upnp/src/gmyth_upnp.c Fri Feb 15 13:52:23 2008 +0000 @@ -212,6 +212,31 @@ g_warning ("Fail to start upnp listener: %d", ret); } +static void +_fill_servers_cb (gpointer key, + gpointer value, + gpointer user_data) +{ + GList **lst; + + lst = (GList **) user_data; + + *lst = g_list_append (*lst, g_object_ref (value)); +} + +GList* +gmyth_upnp_get_devices (GMythUPnP *self) +{ + GMythUPnPPrivate *priv; + GList *lst; + + priv = GMYTH_UPNP_GET_PRIVATE (self); + lst = NULL; + g_hash_table_foreach (priv->servers, (GHFunc) _fill_servers_cb, &lst); + + return lst; +} + static gboolean _idle_emit_device_found_signal (gpointer data) { @@ -329,7 +354,6 @@ g_strdup (uuid), g_object_ref (info)); g_mutex_unlock (priv->mutex); - g_debug ("info url: %s", info_url); g_free (info_url); idle_data = g_new0 (GMythUPnPIdleData, 1); @@ -403,11 +427,9 @@ d_event = (struct Upnp_Discovery *) e; - g_debug ("TYPE: %s", d_event->ServiceType); - if (strcmp (d_event->ServiceType, UPNP_SERVICE_FILTER) != 0) { - g_debug ("invalid device : %s", d_event->DeviceId); + g_warning ("invalid device : %s", d_event->DeviceId); break; } @@ -446,7 +468,6 @@ } default: - g_debug ("No handle event: %d", e_type); break; }