+ // Read xml string
+ if ( strstr( filename, "<svg" ) )
+ {
+ // Generate a temporary file for the svg
+ char fullname[ 1024 ] = "/tmp/mlt.XXXXXX";
+ int fd = g_mkstemp( fullname );
+
+ if ( fd > -1 )
+ {
+ // Write the svg into the temp file
+ ssize_t remaining_bytes;
+ char *xml = filename;
+
+ // Strip leading crap
+ while ( xml[0] != '<' )
+ xml++;
+
+ remaining_bytes = strlen( xml );
+ while ( remaining_bytes > 0 )
+ remaining_bytes -= write( fd, xml + strlen( xml ) - remaining_bytes, remaining_bytes );
+ close( fd );
+
+ mlt_properties_set( this->filenames, "0", fullname );
+
+ // Teehe - when the producer closes, delete the temp file and the space allo
+ mlt_properties_set_data( producer_properties, "__temporary_file__", fullname, 0, ( mlt_destructor )unlink, NULL );
+ }
+ }
+ // Obtain filenames
+ else if ( strchr( filename, '%' ) != NULL )
+ {
+ // handle picture sequences
+ int i = mlt_properties_get_int( producer_properties, "begin" );
+ int gap = 0;
+ char full[1024];
+ int keyvalue = 0;
+ char key[ 50 ];
+
+ while ( gap < 100 )
+ {
+ struct stat buf;
+ snprintf( full, 1023, filename, i ++ );
+ if ( stat( full, &buf ) == 0 )
+ {
+ sprintf( key, "%d", keyvalue ++ );
+ mlt_properties_set( this->filenames, key, full );
+ gap = 0;
+ }
+ else
+ {
+ gap ++;
+ }
+ }
+ if ( mlt_properties_count( this->filenames ) > 0 )
+ mlt_properties_set_int( producer_properties, "ttl", 1 );
+ }
+ else if ( strstr( filename, "/.all." ) != NULL )
+ {
+ char wildcard[ 1024 ];
+ char *dir_name = strdup( filename );
+ char *extension = strrchr( dir_name, '.' );
+
+ *( strstr( dir_name, "/.all." ) + 1 ) = '\0';
+ sprintf( wildcard, "*%s", extension );
+
+ mlt_properties_dir_list( this->filenames, dir_name, wildcard, 1 );
+
+ free( dir_name );
+ }
+ else
+ {
+ mlt_properties_set( this->filenames, "0", filename );
+ }
+
+ this->count = mlt_properties_count( this->filenames );
+}
+
+static void refresh_image( producer_pixbuf this, mlt_frame frame, int width, int height )
+{