track_service( context->destructors, service, (mlt_destructor) mlt_tractor_close );
- mlt_properties_set_position( properties, "length", 0 );
-
for ( ; atts != NULL && *atts != NULL; atts += 2 )
mlt_properties_set( mlt_service_properties( service ), (char*) atts[0], (char*) atts[1] );
- if ( mlt_properties_get_position( properties, "length" ) < mlt_properties_get_position( properties, "out" ) )
- {
- mlt_position length = mlt_properties_get_position( properties, "out" ) + 1;
- mlt_properties_set_position( properties, "length", length );
- }
-
if ( mlt_properties_get( properties, "id" ) != NULL )
mlt_properties_set_data( context->producer_map, mlt_properties_get( properties, "id" ), service, 0, NULL, NULL );
{
mlt_service service = MLT_SERVICE( mlt_tractor_multitrack( MLT_TRACTOR( parent ) ) );
mlt_properties properties = mlt_service_properties( service );
- mlt_properties_set_position( properties, "length", 0 );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
mlt_properties_set( properties, (char*) atts[0], (char*) atts[1] );
track_service( context->destructors, service, (mlt_destructor) mlt_playlist_close );
- mlt_properties_set_position( properties, "length", 0 );
-
for ( ; atts != NULL && *atts != NULL; atts += 2 )
{
mlt_properties_set( properties, ( char* )atts[0], ( char* )atts[1] );
{
mlt_properties properties = mlt_service_properties( service );
mlt_position in = mlt_properties_get_position( properties, "in" );
- mlt_position out;
-
- if ( mlt_properties_get( properties, "_westley.out" ) != NULL )
- out = mlt_properties_get_position( properties, "_westley.out" );
- else
- out = mlt_properties_get_position( properties, "length" ) - 1;
-
- if ( mlt_properties_get_position( properties, "length" ) < out )
- mlt_properties_set_position( properties, "length", out + 1 );
+ mlt_position out = mlt_properties_get_position( properties, "out" );
- mlt_producer_set_in_and_out( MLT_PRODUCER( service ), in, out );
-
// See if the playlist should be added to a playlist or multitrack
if ( add_producer( context, service, in, out ) == 0 )
context_push_service( context, service, type );
else
{
// Otherwise, set in and out on producer directly
- mlt_producer_set_in_and_out( MLT_PRODUCER( service ), in, out );
+ mlt_producer_set_in_and_out( MLT_PRODUCER( producer ), in, out );
}
}
else
mlt_producer_set_in_and_out( MLT_PRODUCER( producer ), in, out );
}
}
-
+
// Push the producer onto the stack
context_push_service( context, producer, mlt_producer_type );
}
if ( multitrack != NULL )
{
- // Set the track on the multitrack
-
// Set producer i/o if specified
- if ( mlt_properties_get( track_props, "in" ) != NULL &&
+ if ( mlt_properties_get( track_props, "in" ) != NULL ||
mlt_properties_get( track_props, "out" ) != NULL )
{
mlt_producer cut = mlt_producer_cut( MLT_PRODUCER( producer ),
if ( parent_type == mlt_tractor_type )
{
mlt_field field = mlt_tractor_field( MLT_TRACTOR( parent ) );
+ if ( mlt_properties_get_int( properties, "a_track" ) == mlt_properties_get_int( properties, "b_track" ) )
+ mlt_properties_set_int( properties, "b_track", mlt_properties_get_int( properties, "a_track" ) + 1 );
mlt_field_plant_transition( field, MLT_TRANSITION( effect ),
mlt_properties_get_int( properties, "a_track" ),
mlt_properties_get_int( properties, "b_track" ) );
struct _xmlParserCtxt *xmlcontext;
int well_formed = 0;
char *filename = NULL;
-
+
context->producer_map = mlt_properties_new();
context->destructors = mlt_properties_new();
context->params = mlt_properties_new();
else
xmlcontext = xmlCreateMemoryParserCtxt( data, strlen( data ) );
+ // Invalid context - clean up and return NULL
+ if ( xmlcontext == NULL )
+ {
+ mlt_properties_close( context->producer_map );
+ mlt_properties_close( context->destructors );
+ mlt_properties_close( context->params );
+ free( context );
+ free( sax );
+ free( filename );
+ return NULL;
+ }
+
xmlcontext->sax = sax;
xmlcontext->_private = ( void* )context;
// Set this var to service properties for convenience
properties = mlt_service_properties( service );
- // make the returned service destroy the connected services
- mlt_properties_set_data( properties, "__destructors__", context->destructors, 0, (mlt_destructor) mlt_properties_close, NULL );
-
// Assign the title
mlt_properties_set( properties, "title", title );
else
{
// Allow the project to be edited
+ mlt_properties_set( properties, "_westley", "was here" );
mlt_properties_set_int( properties, "_mlt_service_hidden", 1 );
}
}
{
// Return null if not well formed
service = NULL;
-
- // Clean up
- mlt_properties_close( context->destructors );
}
// Clean up
mlt_properties_close( context->producer_map );
if ( context->params != NULL )
mlt_properties_close( context->params );
+ mlt_properties_close( context->destructors );
free( context );
free( filename );