X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fwestley%2Fconsumer_westley.c;h=63e320e5b7342bf3f282bae8c3003042d2fef6d6;hb=c12c6c380fa37b6a0d28ce98fdcda487a8aca76d;hp=5b432082cf53a7169454711a874ab83f8539afa0;hpb=b917ae819659606f59b3ae761d06ab2095ade658;p=melted diff --git a/src/modules/westley/consumer_westley.c b/src/modules/westley/consumer_westley.c index 5b43208..63e320e 100644 --- a/src/modules/westley/consumer_westley.c +++ b/src/modules/westley/consumer_westley.c @@ -268,6 +268,8 @@ static void serialise_producer( serialise_context context, mlt_service service, } } +static void serialise_tractor( serialise_context context, mlt_service service, xmlNode *node ); + static void serialise_multitrack( serialise_context context, mlt_service service, xmlNode *node ) { int i; @@ -276,7 +278,10 @@ static void serialise_multitrack( serialise_context context, mlt_service service { // Iterate over the tracks to collect the producers for ( i = 0; i < mlt_multitrack_count( MLT_MULTITRACK( service ) ); i++ ) - serialise_service( context, MLT_SERVICE( mlt_multitrack_track( MLT_MULTITRACK( service ), i ) ), node ); + { + mlt_producer producer = mlt_producer_cut_parent( mlt_multitrack_track( MLT_MULTITRACK( service ), i ) ); + serialise_service( context, MLT_SERVICE( producer ), node ); + } } else { @@ -297,7 +302,7 @@ static void serialise_multitrack( serialise_context context, mlt_service service char *id = westley_get_id( context, MLT_SERVICE( parent ), westley_existing ); xmlNewProp( track, "producer", id ); - if ( mlt_properties_get_int( properties, "cut" ) == 1 ) + if ( mlt_properties_get_int( properties, "_cut" ) == 1 ) { xmlNewProp( track, "in", mlt_properties_get( properties, "in" ) ); xmlNewProp( track, "out", mlt_properties_get( properties, "out" ) ); @@ -311,8 +316,6 @@ static void serialise_multitrack( serialise_context context, mlt_service service } } -static void serialise_tractor( serialise_context context, mlt_service service, xmlNode *node ); - static void serialise_playlist( serialise_context context, mlt_service service, xmlNode *node ) { int i; @@ -337,17 +340,10 @@ static void serialise_playlist( serialise_context context, mlt_service service, mlt_producer producer = mlt_producer_cut_parent( info.producer ); char *service_s = mlt_properties_get( mlt_producer_properties( producer ), "mlt_service" ); char *resource_s = mlt_properties_get( mlt_producer_properties( producer ), "resource" ); - if ( resource_s != NULL && !strcmp( resource_s, "" ) ) - { - serialise_tractor( context, MLT_SERVICE( producer ), node ); - context->pass ++; - serialise_tractor( context, MLT_SERVICE( producer ), node ); - context->pass --; - } + if ( resource_s != NULL && !strcmp( resource_s, "" ) ) + serialise_playlist( context, MLT_SERVICE( producer ), node ); else if ( service_s != NULL && strcmp( service_s, "blank" ) != 0 ) serialise_service( context, MLT_SERVICE( producer ), node ); - else if ( resource_s != NULL && !strcmp( resource_s, "" ) ) - serialise_playlist( context, MLT_SERVICE( producer ), node ); } } } @@ -385,6 +381,11 @@ static void serialise_playlist( serialise_context context, mlt_service service, xmlNewProp( entry, "in", temp ); sprintf( temp, "%d", info.frame_out ); xmlNewProp( entry, "out", temp ); + if ( info.repeat > 1 ) + { + sprintf( temp, "%d", info.repeat ); + xmlNewProp( entry, "repeat", temp ); + } if ( mlt_producer_is_cut( info.cut ) ) serialise_service_filters( context, mlt_producer_service( info.cut ), entry ); } @@ -495,7 +496,20 @@ static void serialise_service( serialise_context context, mlt_service service, x // Tell about the producer if ( strcmp( mlt_type, "producer" ) == 0 ) { - serialise_producer( context, service, node ); + char *mlt_service = mlt_properties_get( properties, "mlt_service" ); + if ( mlt_properties_get( properties, "westley" ) == NULL && !strcmp( mlt_service, "tractor" ) ) + { + context->pass = 0; + serialise_tractor( context, service, node ); + context->pass = 1; + serialise_tractor( context, service, node ); + context->pass = 0; + break; + } + else + { + serialise_producer( context, service, node ); + } if ( mlt_properties_get( properties, "westley" ) != NULL ) break; } @@ -521,7 +535,11 @@ static void serialise_service( serialise_context context, mlt_service service, x // Recurse on tractor's producer else if ( strcmp( resource, "" ) == 0 ) { + context->pass = 0; + serialise_tractor( context, service, node ); + context->pass = 1; serialise_tractor( context, service, node ); + context->pass = 0; break; } @@ -638,12 +656,13 @@ static int consumer_start( mlt_consumer this ) { xmlDocFormatDump( stdout, doc, 1 ); } - else if ( !strcmp( resource, "buffer" ) ) + else if ( strchr( resource, '.' ) == NULL ) { xmlChar *buffer = NULL; int length = 0; xmlDocDumpMemory( doc, &buffer, &length ); - mlt_properties_set_data( properties, "buffer", buffer, length, xmlFree, NULL ); + mlt_properties_set( properties, resource, buffer ); + xmlFree( buffer ); } else {