]> git.sesse.net Git - mlt/commitdiff
real_time=0 fix
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 30 May 2004 19:33:32 +0000 (19:33 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 30 May 2004 19:33:32 +0000 (19:33 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@319 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/sdl/consumer_sdl.c

index 23ff27c90d87ee6c66663bca2f5d005f6aef83ce..eee6cdd79088168c59a1b7d13e58c0791c10d108 100644 (file)
@@ -533,6 +533,9 @@ static void *video_thread( void *arg )
        mlt_properties properties = NULL;
        double speed = 0;
 
+       // Get real time flag
+       int real_time = mlt_properties_get_int( this->properties, "real_time" );
+
        // Get the current time
        gettimeofday( &now, NULL );
 
@@ -569,7 +572,7 @@ static void *video_thread( void *arg )
                        mlt_position difference = scheduled - elapsed;
 
                        // Smooth playback a bit
-                       if ( difference > 20000 && speed == 1.0 )
+                       if ( real_time && ( difference > 20000 && speed == 1.0 ) )
                        {
                                tm.tv_sec = difference / 1000000;
                                tm.tv_nsec = ( difference % 1000000 ) * 500;
@@ -577,11 +580,11 @@ static void *video_thread( void *arg )
                        }
 
                        // Show current frame if not too old
-                       if ( difference > -10000 || speed != 1.0 || mlt_deque_count( this->queue ) < 2 )
+                       if ( !real_time || ( difference > -10000 || speed != 1.0 || mlt_deque_count( this->queue ) < 2 ) )
                                consumer_play_video( this, next );
 
                        // If the queue is empty, recalculate start to allow build up again
-                       if ( mlt_deque_count( this->queue ) == 0 && speed == 1.0 )
+                       if ( real_time && ( mlt_deque_count( this->queue ) == 0 && speed == 1.0 ) )
                        {
                                gettimeofday( &now, NULL );
                                start = ( ( int64_t )now.tv_sec * 1000000 + now.tv_usec ) - scheduled + 20000;