else if ( mlt_producer_is_cut( source ) )
{
producer = source;
- if ( in == -1 )
+ if ( in < 0 )
in = mlt_producer_get_in( producer );
- if ( out == -1 || out > mlt_producer_get_out( producer ) )
+ if ( out < 0 || out > mlt_producer_get_out( producer ) )
out = mlt_producer_get_out( producer );
properties = MLT_PRODUCER_PROPERTIES( producer );
mlt_properties_inc_ref( properties );
else
{
producer = mlt_producer_cut( source, in, out );
- if ( in == -1 || in < mlt_producer_get_in( producer ) )
+ if ( in < 0 || in < mlt_producer_get_in( producer ) )
in = mlt_producer_get_in( producer );
- if ( out == -1 || out > mlt_producer_get_out( producer ) )
+ if ( out < 0 || out > mlt_producer_get_out( producer ) )
out = mlt_producer_get_out( producer );
properties = MLT_PRODUCER_PROPERTIES( producer );
}
// Fetch the cuts parent properties
parent = MLT_PRODUCER_PROPERTIES( mlt_producer_cut_parent( producer ) );
- // Remove fezzik normalisers for fx cuts
+ // Remove loader 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" ) )
+ while ( filter != NULL && mlt_properties_get_int( MLT_FILTER_PROPERTIES( filter ), "_loader" ) )
{
mlt_service_detach( service, filter );
filter = mlt_service_filter( service, 0 );
* \public \memberof mlt_playlist_s
* \param this a playlist
* \param producer the producer to append
- * \param in the starting point on the producer
- * \param out the ending point on the producer
+ * \param in the starting point on the producer; a negative value is the same as 0
+ * \param out the ending point on the producer; a negative value is the same as producer length - 1
* \return true if there was an error
*/
int mlt_playlist_append_io( mlt_playlist this, mlt_producer producer, mlt_position in, mlt_position out )
{
// Append to virtual list
- if ( in != -1 && out != -1 )
- return mlt_playlist_virtual_append( this, producer, in, out );
- else
+ if ( in < 0 && out < 0 )
return mlt_playlist_append( this, producer );
+ else
+ return mlt_playlist_virtual_append( this, producer, in, out );
}
/** Append a blank to the playlist of a given length.
* \public \memberof mlt_playlist_s
* \param this a playlist
* \param clip the index of the playlist entry
- * \param in the new starting time on the clip's producer
- * \param out the new ending time on the clip's producer
+ * \param in the new starting time on the clip's producer; a negative value is the same as 0
+ * \param out the new ending time on the clip's producer; a negative value is the same as length - 1
* \return true if there was an error
*/
}
}
- if ( in <= -1 )
+ if ( in < 0 )
in = 0;
- if ( out <= -1 || out >= mlt_producer_get_length( producer ) )
+ if ( out < 0 || out >= mlt_producer_get_length( producer ) )
out = mlt_producer_get_length( producer ) - 1;
if ( out < in )
{
mlt_properties properties = MLT_PLAYLIST_PROPERTIES( this );
int clip_start = mlt_playlist_clip_start( this, index );
- int clip_length = mlt_playlist_clip_length( this, index );
int list_length = mlt_producer_get_playtime( MLT_PLAYLIST_PRODUCER( this ) );
mlt_events_block( properties, this );
if ( clip_start < position )
{
- mlt_playlist_split( this, index ++, position - clip_start );
- clip_length -= position - clip_start;
+ mlt_playlist_split( this, index ++, position - clip_start - 1 );
}
while( length > 0 )
{
if ( mlt_playlist_clip_length( this, index ) > length )
- mlt_playlist_split( this, index, length );
+ mlt_playlist_split( this, index, length - 1 );
length -= mlt_playlist_clip_length( this, index );
mlt_playlist_remove( this, index );
}