first of a few local tests
[melted] / src / framework / mlt_producer.c
index 1921783..3c953d6 100644 (file)
@@ -104,9 +104,18 @@ int mlt_producer_seek( mlt_producer this, mlt_position position )
 
        // Check bounds
        if ( position < 0 )
+       {
                position = 0;
+       }
        else if ( !strcmp( eof, "pause" ) && position >= mlt_producer_get_playtime( this ) )
+       {
+               mlt_producer_set_speed( this, 0 );
                position = mlt_producer_get_playtime( this ) - 1;
+       }
+       else if ( !strcmp( eof, "loop" ) && position >= mlt_producer_get_playtime( this ) )
+       {
+               position = position % mlt_producer_get_playtime( this );
+       }
 
        // Set the position
        mlt_properties_set_position( mlt_producer_properties( this ), "_position", position );
@@ -240,6 +249,8 @@ static int producer_get_frame( mlt_service service, mlt_frame_ptr frame, int ind
        char *eof = mlt_properties_get( mlt_producer_properties( this ), "eof" );
 
        // A properly instatiated producer will have a get_frame method...
+//fprintf( stderr, "PRODUCER get_frame %p eof %s pos %lld out %lld\n",
+//this->get_frame, eof, mlt_producer_position( this ), mlt_producer_get_out( this ) );
        if ( this->get_frame == NULL || ( !strcmp( eof, "continue" ) && mlt_producer_position( this ) > mlt_producer_get_out( this ) ) )
        {
                // Generate a test frame