Extendible blank producers
[melted] / src / framework / mlt_multitrack.c
index 5d99b3f..d274dbc 100644 (file)
@@ -136,7 +136,7 @@ void mlt_multitrack_refresh( mlt_multitrack this )
                                mlt_properties_set( mlt_producer_properties( producer ), "eof", "continue" );
                        
                        // Determine the longest length
-                       if ( !mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) )
+                       //if ( !mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) )
                                length = mlt_producer_get_playtime( producer ) > length ? mlt_producer_get_playtime( producer ) : length;
                        
                        // Handle fps
@@ -381,8 +381,6 @@ mlt_position mlt_multitrack_clip( mlt_multitrack this, mlt_whence whence, int in
        out of sync.
 
        See playlist logic too.
-
-       This is not as clean as it should be... 
 */
 
 static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int index )
@@ -393,39 +391,32 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind
        // Check if we have a track for this index
        if ( index < this->count && this->list[ index ] != NULL )
        {
-               // Determine the in point
-               int in = mlt_producer_is_cut( this->list[ index ]->producer ) ? mlt_producer_get_in( this->list[ index ]->producer ) : 0;
-
                // Get the producer for this track
-               mlt_producer producer = mlt_producer_cut_parent( this->list[ index ]->producer );
+               mlt_producer producer = this->list[ index ]->producer;
+
+               // Get the track hide property
+               int hide = mlt_properties_get_int( mlt_producer_properties( mlt_producer_cut_parent( producer ) ), "hide" );
 
                // Obtain the current position
                mlt_position position = mlt_producer_frame( parent );
 
-               // Get the clone index
-               int clone_index = mlt_properties_get_int( mlt_producer_properties( this->list[ index ]->producer ), "_clone" );
+               // Get the parent properties
+               mlt_properties producer_properties = mlt_producer_properties( parent );
 
-               // Additionally, check if we're supposed to use a clone here
-               if ( clone_index > 0 )
-               {
-                       char key[ 25 ];
-                       sprintf( key, "_clone.%d", clone_index - 1 );
-                       producer = mlt_properties_get_data( mlt_producer_properties( producer ), key, NULL );
-               }
+               // Get the speed
+               double speed = mlt_properties_get_double( producer_properties, "_speed" );
 
                // Make sure we're at the same point
-               mlt_producer_seek( producer, in + position );
+               mlt_producer_seek( producer, position );
 
                // Get the frame from the producer
                mlt_service_get_frame( mlt_producer_service( producer ), frame, 0 );
 
                // Indicate speed of this producer
-               mlt_properties producer_properties = mlt_producer_properties( parent );
-               double speed = mlt_properties_get_double( producer_properties, "_speed" );
                mlt_properties properties = mlt_frame_properties( *frame );
                mlt_properties_set_double( properties, "_speed", speed );
                mlt_properties_set_position( properties, "_position", position );
-               mlt_properties_set_int( properties, "hide", mlt_properties_get_int( mlt_producer_properties( producer ), "hide" ) );
+               mlt_properties_set_int( properties, "hide", hide );
        }
        else
        {