summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2013-12-14 15:32:29 +0100
committerJens Georg <mail@jensge.org>2014-06-10 12:49:41 +0200
commit556c9a258931ee5f966facbc48a9e881b863a114 (patch)
treecf5dae302ba33f85c9716595348d11761895eb8e
parent456a9ceebcce41674a3acda8070e5ba94ee9ecc3 (diff)
downloadgupnp-av-556c9a258931ee5f966facbc48a9e881b863a114.tar.gz
Revert "Add dlna namespace only when it's actually used"
This reverts commit 50a5e45591e7bccb79250502c22233793dc6b2cb. Conflicts: libgupnp-av/gupnp-didl-lite-writer.c https://bugzilla.gnome.org/show_bug.cgi?id=705564
-rw-r--r--libgupnp-av/gupnp-didl-lite-resource.c1
-rw-r--r--libgupnp-av/gupnp-didl-lite-resource.h1
-rw-r--r--libgupnp-av/gupnp-didl-lite-writer.c34
3 files changed, 2 insertions, 34 deletions
diff --git a/libgupnp-av/gupnp-didl-lite-resource.c b/libgupnp-av/gupnp-didl-lite-resource.c
index d6bf412..f524207 100644
--- a/libgupnp-av/gupnp-didl-lite-resource.c
+++ b/libgupnp-av/gupnp-didl-lite-resource.c
@@ -1468,6 +1468,7 @@ gupnp_didl_lite_resource_set_cleartext_size
resource->priv->dlna_ns,
(unsigned char *) "cleartextSize",
(unsigned char *) str);
+
g_free (str);
}
diff --git a/libgupnp-av/gupnp-didl-lite-resource.h b/libgupnp-av/gupnp-didl-lite-resource.h
index cec572c..5700042 100644
--- a/libgupnp-av/gupnp-didl-lite-resource.h
+++ b/libgupnp-av/gupnp-didl-lite-resource.h
@@ -80,7 +80,6 @@ typedef struct {
void (* _gupnp_reserved4) (void);
} GUPnPDIDLLiteResourceClass;
-
void
gupnp_didl_lite_resource_set_uri (GUPnPDIDLLiteResource *resource,
const char *uri);
diff --git a/libgupnp-av/gupnp-didl-lite-writer.c b/libgupnp-av/gupnp-didl-lite-writer.c
index b61011b..2afc507 100644
--- a/libgupnp-av/gupnp-didl-lite-writer.c
+++ b/libgupnp-av/gupnp-didl-lite-writer.c
@@ -52,8 +52,6 @@ struct _GUPnPDIDLLiteWriterPrivate {
xmlNs *pv_ns;
char *language;
-
- gboolean dlna_attr_present;
};
enum {
@@ -209,19 +207,6 @@ filter_attributes (xmlNode *node,
}
static void
-check_dlna_attr (xmlNode *node,
- GUPnPDIDLLiteWriter *writer)
-{
- xmlAttr *attr;
-
- /* check if dlna prefix is present for a node */
- for (attr = node->properties; attr != NULL; attr = attr->next) {
- if (attr->ns && g_strcmp0 (attr->ns->prefix, "dlna") == 0)
- writer->priv->dlna_attr_present = TRUE;
- }
-}
-
-static void
filter_node (xmlNode *node,
GList *allowed,
GUPnPDIDLLiteWriter *writer,
@@ -236,10 +221,6 @@ filter_node (xmlNode *node,
if (!tags_only)
filter_attributes (node, allowed);
- // Check if dlna namespace attribute is present
- if (!writer->priv->dlna_attr_present)
- check_dlna_attr (node, writer);
-
if (strcmp ((const char *) node->name, "container") == 0) {
is_container = TRUE;
container_class = xml_util_get_child_element_content (node,
@@ -298,13 +279,8 @@ apply_filter (GUPnPDIDLLiteWriter *writer,
g_return_if_fail (GUPNP_IS_DIDL_LITE_WRITER (writer));
g_return_if_fail (filter != NULL);
- if (filter[0] == '*') {
- /* Create DLNA namespace as we include anything anyway */
- xmlNewNs (writer->priv->xml_node,
- writer->priv->dlna_ns->href,
- writer->priv->dlna_ns->prefix);
+ if (filter[0] == '*')
return; /* Wildcard */
- }
tokens = g_strsplit (filter, ",", -1);
g_return_if_fail (tokens != NULL);
@@ -317,12 +293,6 @@ apply_filter (GUPnPDIDLLiteWriter *writer,
node = node->next)
filter_node (node, allowed, writer, tags_only);
- if (writer->priv->dlna_attr_present) {
- xmlNewNs (writer->priv->xml_node,
- writer->priv->dlna_ns->href,
- writer->priv->dlna_ns->prefix);
- }
-
g_list_free (allowed);
g_strfreev (tokens);
}
@@ -408,8 +378,6 @@ gupnp_didl_lite_writer_constructed (GObject *object)
(unsigned char *) "lang",
(unsigned char *) priv->language);
- priv->dlna_attr_present = FALSE;
-
object_class = G_OBJECT_CLASS (gupnp_didl_lite_writer_parent_class);
if (object_class->constructed != NULL)
object_class->constructed (object);