diff --git a/ges/ges-pitivi-formatter.c b/ges/ges-pitivi-formatter.c index 780d47961f..e7ef6a0c28 100644 --- a/ges/ges-pitivi-formatter.c +++ b/ges/ges-pitivi-formatter.c @@ -531,6 +531,30 @@ create_tracks (GESFormatter * self) return TRUE; } +static void +parse_metadatas (GESFormatter * self) +{ + guint i, size; + xmlNodePtr node; + xmlAttr *cur_attr; + xmlNodeSetPtr nodes; + xmlXPathObjectPtr xpathObj; + GESMetaContainer *metacontainer = GES_META_CONTAINER (self->project); + + xpathObj = xmlXPathEvalExpression ((const xmlChar *) + "/pitivi/metadata", GES_PITIVI_FORMATTER (self)->priv->xpathCtx); + nodes = xpathObj->nodesetval; + + size = (nodes) ? nodes->nodeNr : 0; + for (i = 0; i < size; i++) { + node = nodes->nodeTab[i]; + for (cur_attr = node->properties; cur_attr; cur_attr = cur_attr->next) { + ges_meta_container_set_string (metacontainer, (gchar *) cur_attr->name, + (gchar *) xmlGetProp (node, cur_attr->name)); + } + } +} + static void list_sources (GESFormatter * self) { @@ -1023,6 +1047,9 @@ load_pitivi_file_from_uri (GESFormatter * self, priv->xpathCtx = xmlXPathNewContext (doc); + if (self->project) + parse_metadatas (self); + if (!create_tracks (self)) { GST_ERROR ("Couldn't create tracks"); return FALSE;