diff options
author | eddyg <[email protected]> | 2007-10-09 02:40:51 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2007-10-09 02:40:51 +0000 |
commit | a0d8a7072dec077566fa1d5c67e6a6a99a09cc38 (patch) | |
tree | 1cacc48782ba82dc8863e105e8c7a063f99f53ab /test/test.c | |
parent | 1e3bd57546c713d238cad5b9d16faf61f50652e8 (diff) |
Change the progress messages to use stdout, added a flush after each progress update to ensure timly updates for windows.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1013 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r-- | test/test.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/test.c b/test/test.c index a5ddddf25..b9b0c4254 100644 --- a/test/test.c +++ b/test/test.c @@ -188,9 +188,11 @@ int main( int argc, char ** argv ) switch( buf[0] ) { case 'q': + fprintf( stdout, "\nEncoding Quit by user command\n" ); die = 1; break; case 'p': + fprintf( stdout, "\nEncoding Paused by user command, 'r' to resume\n" ); hb_pause( h ); break; case 'r': @@ -227,11 +229,11 @@ int main( int argc, char ** argv ) static void ShowCommands() { - fprintf( stderr, "Commands:\n" ); - fprintf( stderr, " [h]elp Show this message\n" ); - fprintf( stderr, " [q]uit Exit HandBrakeCLI\n" ); - fprintf( stderr, " [p]ause Pause encoding\n" ); - fprintf( stderr, " [r]esume Resume encoding\n" ); + fprintf( stdout, "\nCommands:\n" ); + fprintf( stdout, " [h]elp Show this message\n" ); + fprintf( stdout, " [q]uit Exit HandBrakeCLI\n" ); + fprintf( stdout, " [p]ause Pause encoding\n" ); + fprintf( stdout, " [r]esume Resume encoding\n" ); } static void PrintTitleInfo( hb_title_t * title ) @@ -725,21 +727,23 @@ static int HandleEvents( hb_handle_t * h ) #define p s.param.working case HB_STATE_WORKING: - fprintf( stderr, "\rEncoding: task %d of %d, %.2f %%", + fprintf( stdout, "\rEncoding: task %d of %d, %.2f %%", p.job_cur, p.job_count, 100.0 * p.progress ); if( p.seconds > -1 ) { - fprintf( stderr, " (%.2f fps, avg %.2f fps, ETA " + fprintf( stdout, " (%.2f fps, avg %.2f fps, ETA " "%02dh%02dm%02ds)", p.rate_cur, p.rate_avg, p.hours, p.minutes, p.seconds ); } + fflush(stdout); break; #undef p #define p s.param.muxing case HB_STATE_MUXING: { - fprintf( stderr, "\rMuxing: %.2f %%", 100.0 * p.progress ); + fprintf( stdout, "\rMuxing: %.2f %%", 100.0 * p.progress ); + fflush(stdout); break; } #undef p |