]> git.sesse.net Git - mlt/blobdiff - src/framework/mlt_playlist.c
Detect video codecs that use the new libavcodec "encode2" method.
[mlt] / src / framework / mlt_playlist.c
index 10975bfb14f91fed93b3a0075c6b9d07f463e8cd..356b0d79de09543136165e8c1b8adfe05e41980c 100644 (file)
@@ -234,8 +234,10 @@ static int mlt_playlist_virtual_append( mlt_playlist self, mlt_producer source,
        // If we have a cut, then use the in/out points from the cut
        if ( mlt_producer_is_blank( source )  )
        {
+               mlt_position length = out - in + 1;
+
                // Make sure the blank is long enough to accomodate the length specified
-               if ( out - in + 1 > mlt_producer_get_length( &self->blank ) )
+               if ( length > mlt_producer_get_length( &self->blank ) )
                {
                        mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &self->blank );
                        mlt_events_block( blank_props, blank_props );
@@ -259,6 +261,10 @@ static int mlt_playlist_virtual_append( mlt_playlist self, mlt_producer source,
                }
 
                properties = MLT_PRODUCER_PROPERTIES( producer );
+
+               // Make sure this cut of blank is long enough
+               if ( length > mlt_producer_get_length( producer ) )
+                       mlt_properties_set_int( properties, "length", length );
        }
        else if ( mlt_producer_is_cut( source ) )
        {
@@ -920,14 +926,18 @@ int mlt_playlist_resize_clip( mlt_playlist self, int clip, mlt_position in, mlt_
 
                if ( mlt_producer_is_blank( producer ) )
                {
-                       // Make sure the blank is long enough to accomodate the length specified
-                       if ( out - in + 1 > mlt_producer_get_length( &self->blank ) )
+                       mlt_position length = out - in + 1;
+
+                       // Make sure the parent blank is long enough to accomodate the length specified
+                       if ( length > mlt_producer_get_length( &self->blank ) )
                        {
                                mlt_properties blank_props = MLT_PRODUCER_PROPERTIES( &self->blank );
-                               mlt_properties_set_int( blank_props, "length", out - in + 1 );
-                               mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( producer ), "length", out - in + 1 );
+                               mlt_properties_set_int( blank_props, "length", length );
                                mlt_producer_set_in_and_out( &self->blank, 0, out - in );
                        }
+                       // Make sure this cut of blank is long enough
+                       if ( length > mlt_producer_get_length( producer ) )
+                               mlt_properties_set_int( MLT_PRODUCER_PROPERTIES( producer ), "length", length );
                }
 
                if ( in < 0 )
@@ -979,12 +989,14 @@ int mlt_playlist_split( mlt_playlist self, int clip, mlt_position position )
                                mlt_producer split = mlt_producer_cut( entry->producer, in + position + 1, out );
                                mlt_properties split_properties = MLT_PRODUCER_PROPERTIES( split );
                                mlt_playlist_insert( self, split, clip + 1, 0, -1 );
+                               mlt_properties_lock( entry_properties );
                                for ( i = 0; i < mlt_properties_count( entry_properties ); i ++ )
                                {
                                        char *name = mlt_properties_get_name( entry_properties, i );
                                        if ( name != NULL && !strncmp( name, "meta.", 5 ) )
                                                mlt_properties_set( split_properties, name, mlt_properties_get_value( entry_properties, i ) );
                                }
+                               mlt_properties_unlock( entry_properties );
                                mlt_producer_close( split );
                        }
                        else