X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_playlist.c;h=b5e7fb35c9e85cf813a54496cf764ae8add19522;hb=9bee7421e4b65a36f9977482a88027e8a5260eeb;hp=240c523ef1bde847b79761564ea506b68ac1a136;hpb=a07c3da76259d6ba479d800ffecc5617a9ad158f;p=melted diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 240c523..b5e7fb3 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -1271,7 +1271,7 @@ int mlt_playlist_insert_at( mlt_playlist this, mlt_position position, mlt_produc if ( clip < this->count && mlt_playlist_is_blank( this, clip ) ) { // Split and move to new clip if need be - if ( position != info.start && mlt_playlist_split( this, clip, position - info.start ) == 0 ) + if ( position != info.start && mlt_playlist_split( this, clip, position - info.start - 1 ) == 0 ) mlt_playlist_get_clip_info( this, &info, ++ clip ); // Split again if need be @@ -1301,8 +1301,12 @@ int mlt_playlist_insert_at( mlt_playlist this, mlt_position position, mlt_produc } else { - if ( mode == 1 ) - mlt_playlist_blank( this, position - mlt_properties_get_int( properties, "length" ) ); + if ( mode == 1 ) { + if ( position == info.start ) + mlt_playlist_remove( this, clip ); + else + mlt_playlist_blank( this, position - mlt_properties_get_int( properties, "length" ) - 1 ); + } mlt_playlist_append( this, producer ); ret = this->count - 1; } @@ -1409,8 +1413,8 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // Check that we have a producer if ( producer == NULL ) { - *frame = mlt_frame_init( ); - return 0; + *frame = NULL; + return -1; } // Get this mlt_playlist @@ -1425,7 +1429,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i // Check that we have a producer if ( real == NULL ) { - *frame = mlt_frame_init( ); + *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) ); return 0; } @@ -1437,7 +1441,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i else { mlt_producer parent = mlt_producer_cut_parent( ( mlt_producer )real ); - *frame = mlt_frame_init( ); + *frame = mlt_frame_init( MLT_PRODUCER_SERVICE( parent ) ); mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "fx_cut", 1 ); mlt_frame_push_service( *frame, NULL ); mlt_frame_push_audio( *frame, NULL );