]> git.sesse.net Git - mlt/commitdiff
fix letting xml playlist load like virtual clip
authorDan Dennedy <dan@dennedy.org>
Sat, 22 Sep 2012 20:53:04 +0000 (13:53 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 22 Sep 2012 20:53:04 +0000 (13:53 -0700)
If an application wants to detect if deserialized XML is a playlist or
mulitrack project, then it can check the new _original_type and
_original_resource properties.

src/modules/xml/producer_xml.c

index 2baec97d11b042ece5bfca8f63ca3e369fe99eb0..fa5d4d5bfa2f503685f608aadc625dd168178c43 100644 (file)
@@ -1734,8 +1734,17 @@ mlt_producer producer_xml_init( mlt_profile profile, mlt_service_type servtype,
                if ( getenv( "MLT_XML_DEEP" ) == NULL )
                {
                        // Now assign additional properties
-                       if ( is_filename && mlt_service_identify( service ) == tractor_type )
+                       if ( is_filename && (
+                               mlt_service_identify( service ) == tractor_type ||
+                               mlt_service_identify( service ) == playlist_type ||
+                               mlt_service_identify( service ) == multitrack_type ) )
+                       {
+                               mlt_properties_set_int( properties, "_original_type",
+                                       mlt_service_identify( service ) );
+                               mlt_properties_set( properties, "_original_resource",
+                                       mlt_properties_get( properties, "resource" ) );
                                mlt_properties_set( properties, "resource", data );
+                       }
 
                        // This tells consumer_xml not to deep copy
                        mlt_properties_set( properties, "xml", "was here" );