]> git.sesse.net Git - mlt/commitdiff
accept file:// prefix on MLT XML file
authorDan Dennedy <dan@dennedy.org>
Fri, 13 Jul 2012 04:19:56 +0000 (21:19 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 13 Jul 2012 04:19:56 +0000 (21:19 -0700)
src/modules/core/producer_loader.c
src/modules/xml/producer_xml.c

index d381e3bc58b51968c571036ec1e6c033679302f7..7b43c0c2e8722a2bda658e02562e15625d50d514 100644 (file)
@@ -90,11 +90,16 @@ static mlt_producer create_producer( mlt_profile profile, char *file )
                        p ++;
                }
 
+               // Strip file:// prefix
+               p = lookup;
+               if ( strncmp( lookup, "file://", 7 ) == 0 )
+                       p += 7;
+
                // Iterate through the dictionary
                for ( i = 0; result == NULL && i < mlt_properties_count( dictionary ); i ++ )
                {
                        char *name = mlt_properties_get_name( dictionary, i );
-                       if ( fnmatch( name, lookup, 0 ) == 0 )
+                       if ( fnmatch( name, p, 0 ) == 0 )
                                result = create_from( profile, file, mlt_properties_get_value( dictionary, i ) );
                }       
 
index 88d7eebcda232d0baffd492791f7335478d262f2..a9396fe1f9d426a0b4b540c0d1eccd897daa753d 100644 (file)
@@ -1541,6 +1541,10 @@ mlt_producer producer_xml_init( mlt_profile profile, mlt_service_type servtype,
        char *filename = NULL;
        int info = strcmp( id, "xml-string" ) ? 0 : 1;
 
+       // Strip file:// prefix
+       if ( data && strlen( data ) >= 7 && strncmp( data, "file://", 7 ) == 0 )
+               data += 7;
+
        if ( data == NULL || !strcmp( data, "" ) || ( info == 0 && !file_exists( data ) ) )
                return NULL;