// Fetch the cuts parent properties
parent = MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( producer ) );
+ // Remove fezzik normalisers for fx cuts
+ if ( mlt_properties_get_int( parent, "meta.fx_cut" ) )
+ {
+ mlt_service service = MLT_PRODUCER_SERVICE( mlt_producer_cut_parent( producer ) );
+ mlt_filter filter = mlt_service_filter( service, 0 );
+ while ( filter != NULL && mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "_fezzik" ) )
+ {
+ mlt_service_detach( service, filter );
+ filter = mlt_service_filter( service, 0 );
+ }
+ mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( producer ), "meta.fx_cut", 1 );
+ }
+
// Check that we have room
if ( this->count >= this->size )
{
int mlt_playlist_join( mlt_playlist this, int clip, int count, int merge )
{
- int error = clip < 0 || ( clip ) >= this->count;
+ int error = clip < 0 || clip >= this->count;
if ( error == 0 )
{
int i = clip;
mlt_playlist new_clip = mlt_playlist_init( );
mlt_events_block( MLT_PLAYLIST_PROPERTIES( this ), this );
if ( clip + count >= this->count )
- count = this->count - clip;
+ count = this->count - clip - 1;
for ( i = 0; i <= count; i ++ )
{
playlist_entry *entry = this->list[ clip ];
}
}
- if ( !keep_length )
+ if ( !keep_length && this->count > 0 )
{
playlist_entry *last = this->list[ this->count - 1 ];
if ( mlt_producer_is_blank( last->producer ) )
mlt_playlist_clip_info info;
if ( mlt_playlist_get_clip_info( this, &info, clip ) == 0 )
return info.start;
- return 0;
+ return clip < 0 ? 0 : mlt_producer_get_playtime( MLT_PLAYLIST_PRODUCER( this ) );
}
int mlt_playlist_clip_length( mlt_playlist this, int clip )
}
// Get the frame
- mlt_service_get_frame( real, frame, index );
+ if ( !mlt_properties_get_int( MLT_SERVICE_PROPERTIES( real ), "meta.fx_cut" ) )
+ {
+ mlt_service_get_frame( real, frame, index );
+ }
+ else
+ {
+ mlt_producer parent = mlt_producer_cut_parent( ( mlt_producer )real );
+ *frame = mlt_frame_init( );
+ mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "fx_cut", 1 );
+ mlt_frame_push_service( *frame, NULL );
+ mlt_frame_push_audio( *frame, NULL );
+ mlt_service_apply_filters( MLT_PRODUCER_SERVICE( parent ), *frame, 0 );
+ mlt_service_apply_filters( real, *frame, 0 );
+ mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( *frame ) );
+ mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( *frame ) );
+ }
// Check if we're at the end of the clip
mlt_properties properties = MLT_FRAME_PROPERTIES( *frame );