X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_playlist.c;h=928c76d0c9af402b1dc35a074f9d7ce639556535;hb=a2b4b63a98cff9bbf979f446d0351d8978365518;hp=bf1103df304691857df59ee5145b2c1080cb1dc0;hpb=ebe424a8561adf11509de6a1ed504ce07a8abdaf;p=melted diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index bf1103d..928c76d 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -75,6 +75,8 @@ mlt_playlist mlt_playlist_init( ) // Initialise blank mlt_producer_init( &this->blank, NULL ); + mlt_properties_set( mlt_producer_properties( &this->blank ), "mlt_service", "blank" ); + mlt_properties_set( mlt_producer_properties( &this->blank ), "resource", "blank" ); // Indicate that this producer is a playlist mlt_properties_set_data( mlt_playlist_properties( this ), "playlist", this, 0, NULL, NULL ); @@ -176,7 +178,7 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer producer this->list[ this->count ]->frame_out = out; this->list[ this->count ]->frame_count = out - in + 1; - mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" ); + mlt_properties_set( mlt_producer_properties( producer ), "eof", "pause" ); mlt_producer_set_speed( producer, 0 ); @@ -196,6 +198,8 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) // Map playlist position to real producer in virtual playlist mlt_position position = mlt_producer_frame( &this->parent ); + mlt_position original = position; + // Total number of frames int64_t total = 0; @@ -238,10 +242,11 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) { playlist_entry *entry = this->list[ this->count - 1 ]; mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek( this_producer, total - 1 - mlt_producer_get_in( this_producer ) ); + mlt_producer_seek( this_producer, original - 1 ); producer = entry->producer; mlt_producer_seek( producer, entry->frame_out ); mlt_producer_set_speed( this_producer, 0 ); + mlt_producer_set_speed( producer, 0 ); } else if ( !strcmp( eof, "loop" ) && total > 0 ) { @@ -544,18 +549,17 @@ int mlt_playlist_move( mlt_playlist this, int src, int dest ) else if ( current == dest ) current = src; + src_entry = this->list[ src ]; if ( src > dest ) { - int t = dest; - dest = src; - src = t; + for ( i = src; i > dest; i -- ) + this->list[ i ] = this->list[ i - 1 ]; + } + else + { + for ( i = src; i < dest; i ++ ) + this->list[ i ] = this->list[ i + 1 ]; } - - src_entry = this->list[ src ]; - - for ( i = src + 1; i <= dest; i ++ ) - this->list[ i - 1 ] = this->list[ i ]; - this->list[ dest ] = src_entry; mlt_playlist_get_clip_info( this, ¤t_info, current );