]> git.sesse.net Git - mlt/commitdiff
Add -progress2 option to get progress with newlines.
authorDan Dennedy <dan@dennedy.org>
Sun, 9 Oct 2011 22:39:09 +0000 (15:39 -0700)
committerDan Dennedy <dan@dennedy.org>
Sun, 9 Oct 2011 22:39:09 +0000 (15:39 -0700)
Makes easier to get progress updates in some scripts.

src/melt/melt.c

index a9283690111944cf104011ef6d1f8f449dd7e4c8..2c16863396cf7927d6a794b7ebf1c40c4e89b3b1 100644 (file)
@@ -354,8 +354,9 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
                                        int current_position = mlt_producer_position( producer );
                                        if ( current_position > last_position )
                                        {
-                                               fprintf( stderr, "Current Frame: %10d, percentage: %10d\r",
-                                                       current_position, 100 * current_position / total_length );
+                                               fprintf( stderr, "Current Frame: %10d, percentage: %10d%c",
+                                                       current_position, 100 * current_position / total_length,
+                                                       progress == 2 ? '\n' : '\r' );
                                                last_position = current_position;
                                        }
                                }
@@ -659,6 +660,10 @@ int main( int argc, char **argv )
                {
                        is_progress = 1;
                }
+               else if ( !strcmp( argv[ i ], "-progress2" ) )
+               {
+                       is_progress = 2;
+               }
                // Look for the query option
                else if ( !strcmp( argv[ i ], "-query" ) )
                {