X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_playlist.c;h=084af24f55a3acc0cf576b4645f9c349cfde012d;hb=b85660b63fd9e5becfdbea592a28ae18fa5f991e;hp=e2adc630c024717b028cf090762c3f465d314f41;hpb=a162148e8a943e50f41941104b6c418ac8b95236;p=melted diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index e2adc63..084af24 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -333,6 +333,27 @@ static mlt_service mlt_playlist_virtual_seek( mlt_playlist this, int *progressiv // Get the properties mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this ); + // Automatically close previous producers if requested + if ( i > 1 // keep immediate previous in case app wants to get info about what just finished + && position < 2 // tolerate off-by-one error on going to next clip + && mlt_properties_get_int( properties, "autoclose" ) ) + { + int j; + // They might have jumped ahead! + for ( j = 0; j < i - 1; j++ ) + { + mlt_service_lock( MLT_PRODUCER_SERVICE( this->list[ j ]->producer ) ); + mlt_producer p = this->list[ j ]->producer; + if ( p ) + { + this->list[ j ]->producer = NULL; + mlt_service_unlock( MLT_PRODUCER_SERVICE( p ) ); + mlt_producer_close( p ); + } + // If p is null, the lock will not have been "taken" + } + } + // Get the eof handling char *eof = mlt_properties_get( properties, "eof" );