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;
+ mlt_position out = mlt_properties_get_position( properties, "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_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 );
if ( mlt_properties_get( track_props, "in" ) != NULL ||
mlt_properties_get( track_props, "out" ) != NULL )
{
- if ( mlt_properties_get( track_props, "out" ) == NULL )
- mlt_properties_set_position( track_props, "out", mlt_properties_get_position( track_props, "length" ) - 1 );
mlt_producer cut = mlt_producer_cut( MLT_PRODUCER( producer ),
mlt_properties_get_position( track_props, "in" ),
mlt_properties_get_position( track_props, "out" ) );
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 );
{
// 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 );