From d5ba9edc78f7538d0d212c0712e4197521474160 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Wed, 23 Mar 2011 20:59:41 -0700 Subject: [PATCH] Fix restoring of console title on Windows with ffms indexing --- x264.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/x264.c b/x264.c index 92695abd..1c551f87 100644 --- a/x264.c +++ b/x264.c @@ -74,6 +74,8 @@ static void sigint_handler( int a ) b_ctrl_c = 1; } +static char UNUSED originalCTitle[200] = ""; + typedef struct { int b_progress; int i_seek; @@ -262,6 +264,8 @@ int main( int argc, char **argv ) _setmode(_fileno(stdout), _O_BINARY); #endif + GetConsoleTitle( originalCTitle, sizeof(originalCTitle) ); + /* Parse command line */ if( parse( argc, argv, ¶m, &opt ) < 0 ) ret = -1; @@ -284,6 +288,8 @@ int main( int argc, char **argv ) if( opt.qpfile ) fclose( opt.qpfile ); + SetConsoleTitle( originalCTitle ); + return ret; } @@ -1644,9 +1650,6 @@ static int encode( x264_param_t *param, cli_opt_t *opt ) double duration; double pulldown_pts = 0; int retval = 0; - char UNUSED originalCTitle[200] = ""; - - GetConsoleTitle( originalCTitle, sizeof(originalCTitle) ); opt->b_progress &= param->i_log_level < X264_LOG_DEBUG; @@ -1805,7 +1808,5 @@ fail: (double) i_file * 8 / ( 1000 * duration ) ); } - SetConsoleTitle( originalCTitle ); - return retval; } -- 2.47.3