]> git.sesse.net Git - mlt/blobdiff - src/melt/melt.c
fix melt progress display on Windows
[mlt] / src / melt / melt.c
index c125a72e511364594856cb46e652b90551bc456d..066b2511209ce38c7061fffa1d4b0e7e58f89f60 100644 (file)
@@ -353,7 +353,7 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
        mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
        int silent = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "silent" );
        int progress = mlt_properties_get_int( MLT_CONSUMER_PROPERTIES( consumer ), "progress" );
-       struct timespec tm = { 0, 40000 };
+       struct timespec tm = { 0, 40000000 };
        int total_length = mlt_producer_get_length( producer );
        int last_position = 0;
 
@@ -406,6 +406,7 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
                                {
                                        fprintf( stderr, "Current Position: %10d\r", (int)mlt_consumer_position( consumer ) );
                                }
+                               fflush( stderr );
                        }
 
                        if ( silent || progress )
@@ -672,7 +673,7 @@ int main( int argc, char **argv )
        // Construct the factory
        mlt_repository repo = mlt_factory_init( NULL );
 
-#ifdef WIN32
+#if defined(WIN32) && !defined(MELT_NOSDL)
        is_silent = 1;
 #endif
        
@@ -782,7 +783,7 @@ query_all:
                        mlt_log_set_level( MLT_LOG_DEBUG );
                }
        }
-       if ( !is_silent && !isatty( STDIN_FILENO ) )
+       if ( !is_silent && !isatty( STDIN_FILENO ) && !is_progress )
                is_progress = 1;
 
        // Create profile if not set explicitly