]> git.sesse.net Git - mlt/blobdiff - src/modules/xml/consumer_xml.c
Merge branch 'master' of git://mltframework.org/mlt
[mlt] / src / modules / xml / consumer_xml.c
index 9e85e6ecbc97979f125f7cf846558b837bf9217d..fae400b0a8170b2b391d25411307aa1a95cb3f16 100644 (file)
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <pthread.h>
 #include <unistd.h>
 #include <libxml/tree.h>
 
@@ -192,8 +191,9 @@ static void serialise_properties( serialise_context context, mlt_properties prop
                         strcmp( name, "height" ) != 0 )
                {
                        char *value = mlt_properties_get_value( properties, i );
-                       if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) )
-                               value += strlen( context->root ) + 1;
+                       int rootlen = strlen( context->root );
+                       if ( rootlen && !strncmp( value, context->root, rootlen ) && value[ rootlen ] == '/' )
+                               value += rootlen + 1;
                        p = xmlNewTextChild( node, NULL, _x("property"), _x(value) );
                        xmlNewProp( p, _x("name"), _x(name) );
                }
@@ -214,8 +214,9 @@ static void serialise_store_properties( serialise_context context, mlt_propertie
                        char *value = mlt_properties_get_value( properties, i );
                        if ( value != NULL )
                        {
-                               if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) )
-                                       value += strlen( context->root ) + 1;
+                               int rootlen = strlen( context->root );
+                               if ( rootlen && !strncmp( value, context->root, rootlen ) && value[ rootlen ] == '/' )
+                                       value += rootlen + 1;
                                p = xmlNewTextChild( node, NULL, _x("property"), _x(value) );
                                xmlNewProp( p, _x("name"), _x(name) );
                        }