mlt_producer mlt_multitrack_producer( mlt_multitrack this )
{
- return &this->parent;
+ return this != NULL ? &this->parent : NULL;
}
/** Get the service associated this multitrack.
mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" );
// Determine the longest length
- length = mlt_producer_get_playtime( producer ) > length ? mlt_producer_get_playtime( producer ) : length;
+ if ( !mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) )
+ length = mlt_producer_get_playtime( producer ) > length ? mlt_producer_get_playtime( producer ) : length;
// Handle fps
if ( fps == 0 )
// Get the producer for this track
mlt_producer producer = this->list[ i ];
- // If it's assigned...
+ // If it's assigned and not a hidden track
if ( producer != NULL )
{
// Get the properties of this producer
void mlt_multitrack_close( mlt_multitrack this )
{
- // Close the producer
- mlt_producer_close( &this->parent );
+ if ( this != NULL && mlt_properties_dec_ref( mlt_multitrack_properties( this ) ) <= 0 )
+ {
+ // Close the producer
+ mlt_producer_close( &this->parent );
- // Free the list
- free( this->list );
+ // Free the list
+ free( this->list );
- // Free the object
- free( this );
+ // Free the object
+ free( this );
+ }
}