]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_playlist.c
Merge branch 'master' of git://mltframework.org/mlt into kdenlivetitle
[mlt] / src / framework / mlt_playlist.c
index 1710e21db12edad6f0f7baa89ca8c6cefb88d617..94c4d418eb293806efe2d263429991cbca699f12 100644 (file)
@@ -1,8 +1,9 @@
 /**
  * \file mlt_playlist.c
  * \brief playlist service class
+ * \see mlt_playlist_s
  *
- * Copyright (C) 2003-2008 Ushodaya Enterprises Limited
+ * Copyright (C) 2003-2009 Ushodaya Enterprises Limited
  * \author Charles Yates <charles.yates@pandora.be>
  *
  * This library is free software; you can redistribute it and/or
@@ -31,7 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-/** \brief virtual playlist entry
+/** \brief Virtual playlist entry used by mlt_playlist_s
 */
 
 struct playlist_entry_s
@@ -282,12 +283,12 @@ static int mlt_playlist_virtual_append( mlt_playlist this, mlt_producer source,
        // 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 );
@@ -1679,7 +1680,6 @@ int mlt_playlist_remove_region( mlt_playlist this, mlt_position position, int le
        {
                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 );
 
@@ -1688,14 +1688,13 @@ int mlt_playlist_remove_region( mlt_playlist this, mlt_position position, int le
 
                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 )
+               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 );
                }