From f7e7842cf52946218db15c6a45958644a96248d6 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Tue, 8 Jan 2008 06:53:42 +0000 Subject: [PATCH] mlt_playlist.c: fix some blank-handling bugs in mlt_playlist_insert_at() git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1046 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/framework/mlt_playlist.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 240c523..7dbbd7b 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; } -- 1.7.4.4