From: lilo_booter Date: Sun, 11 Jan 2004 00:11:18 +0000 (+0000) Subject: end of playlist position fix X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=306a514a9739dc206a4c567dace10921934ef3ff;p=melted end of playlist position fix git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@51 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt/src/framework/mlt_playlist.c b/mlt/src/framework/mlt_playlist.c index 300dcc1..00c98cd 100644 --- a/mlt/src/framework/mlt_playlist.c +++ b/mlt/src/framework/mlt_playlist.c @@ -206,7 +206,6 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) { // Found it, now break producer = this->list[ i ]->producer; - position += this->list[ i ]->frame_in; break; } else @@ -219,15 +218,18 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) // Seek in real producer to relative position if ( producer != NULL ) { - mlt_producer_seek_frame( producer, position + mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ) ); + position += this->list[ i ]->frame_in; + position += mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ); + mlt_producer_seek_frame( producer, position ); } else if ( total > 0 ) { playlist_entry *entry = this->list[ this->count - 1 ]; mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek_frame( this_producer, total - 1 ); + mlt_producer_seek_frame( this_producer, total ); producer = entry->producer; - mlt_producer_seek_frame( producer, entry->frame_out ); + position = mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ); + mlt_producer_seek_frame( producer, position + entry->frame_out ); } else { diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 300dcc1..00c98cd 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -206,7 +206,6 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) { // Found it, now break producer = this->list[ i ]->producer; - position += this->list[ i ]->frame_in; break; } else @@ -219,15 +218,18 @@ static mlt_producer mlt_playlist_virtual_seek( mlt_playlist this ) // Seek in real producer to relative position if ( producer != NULL ) { - mlt_producer_seek_frame( producer, position + mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ) ); + position += this->list[ i ]->frame_in; + position += mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ); + mlt_producer_seek_frame( producer, position ); } else if ( total > 0 ) { playlist_entry *entry = this->list[ this->count - 1 ]; mlt_producer this_producer = mlt_playlist_producer( this ); - mlt_producer_seek_frame( this_producer, total - 1 ); + mlt_producer_seek_frame( this_producer, total ); producer = entry->producer; - mlt_producer_seek_frame( producer, entry->frame_out ); + position = mlt_producer_frame_position( producer, mlt_producer_get_in( producer ) ); + mlt_producer_seek_frame( producer, position + entry->frame_out ); } else {