X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_playlist.c;h=e2adc630c024717b028cf090762c3f465d314f41;hb=1d3e58c2164a57bd0cec1270cba89cead0d97e88;hp=eac06425a87b7c7390b7178fc117ce22d83e1b1b;hpb=bf3264b9e340ba5c11cbf59835a8af3db94e0cc2;p=melted diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index eac0642..e2adc63 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -18,8 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "config.h" - #include "mlt_playlist.h" #include "mlt_tractor.h" #include "mlt_multitrack.h" @@ -127,9 +125,6 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this ) { // Obtain the properties mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this ); - - // Get the fps of the first producer - double fps = mlt_properties_get_double( properties, "first_fps" ); int i = 0; mlt_position frame_count = 0; @@ -139,21 +134,6 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this ) mlt_producer producer = this->list[ i ]->producer; int current_length = mlt_producer_get_out( producer ) - mlt_producer_get_in( producer ) + 1; - // If fps is 0 - if ( fps == 0 ) - { - // Inherit it from the producer - fps = mlt_producer_get_fps( producer ); - } - else if ( fps != mlt_properties_get_double( MLT_PRODUCER_PROPERTIES( producer ), "fps" ) ) - { - // Generate a warning for now - the following attempt to fix may fail - fprintf( stderr, "Warning: fps mismatch on playlist producer %d\n", this->count ); - - // It should be safe to impose fps on an image producer, but not necessarily safe for video - mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( producer ), "fps", fps ); - } - // Check if the length of the producer has changed if ( this->list[ i ]->frame_in != mlt_producer_get_in( producer ) || this->list[ i ]->frame_out != mlt_producer_get_out( producer ) ) @@ -184,8 +164,6 @@ static int mlt_playlist_virtual_refresh( mlt_playlist this ) } // Refresh all properties - mlt_properties_set_double( properties, "first_fps", fps ); - mlt_properties_set_double( properties, "fps", fps == 0 ? 25 : fps ); mlt_events_block( properties, properties ); mlt_properties_set_position( properties, "length", frame_count ); mlt_events_unblock( properties, properties ); @@ -561,7 +539,6 @@ int mlt_playlist_clear( mlt_playlist this ) mlt_producer_close( this->list[ i ]->producer ); } this->count = 0; - mlt_properties_set_double( MLT_PLAYLIST_PROPERTIES( this ), "first_fps", 0 ); return mlt_playlist_virtual_refresh( this ); } @@ -1292,7 +1269,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 @@ -1322,8 +1299,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; } @@ -1430,8 +1411,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 @@ -1446,7 +1427,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; } @@ -1458,7 +1439,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 );