From a17b650751f9726b7f4a9a50ca3c153674cfc6f2 Mon Sep 17 00:00:00 2001 From: Alexander Prikhodko Date: Wed, 7 Apr 2010 13:16:02 +0300 Subject: [PATCH] Restore console title for CLI --- x264.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/x264.c b/x264.c index 2a5986a..2388c1f 100644 --- a/x264.c +++ b/x264.c @@ -1412,6 +1412,9 @@ static int Encode( x264_param_t *param, cli_opt_t *opt ) int prev_timebase_den = param->i_timebase_den / gcd( param->i_timebase_num, param->i_timebase_den ); int dts_compress_multiplier; double pulldown_pts = 0; + #ifdef _WIN32 + char originalCTitle[200]; + #endif opt->b_progress &= param->i_log_level < X264_LOG_DEBUG; i_frame_total = input.get_frame_total( opt->hin ); @@ -1490,6 +1493,10 @@ static int Encode( x264_param_t *param, cli_opt_t *opt ) if( opt->tcfile_out ) fprintf( opt->tcfile_out, "# timecode format v2\n" ); + #ifdef _WIN32 + GetConsoleTitle( originalCTitle, 200 ); + #endif + /* Encode frames */ for( i_frame = 0, i_frame_output = 0; b_ctrl_c == 0 && (i_frame < i_frame_total || i_frame_total == 0); ) { @@ -1578,6 +1585,10 @@ static int Encode( x264_param_t *param, cli_opt_t *opt ) if( !(opt->i_pulldown && !param->b_vfr_input) ) duration *= dts_compress_multiplier; + #ifdef _WIN32 + SetConsoleTitle( originalCTitle ); + #endif + i_end = x264_mdate(); input.picture_clean( &pic ); /* Erase progress indicator before printing encoding stats. */ -- 1.7.0.2.msysgit.0