From 0c3054f0dfc84b99b8305ebbeb647533a741994d Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Tue, 5 Apr 2011 14:06:54 +0400 Subject: [PATCH] Disable progress for FFMS input with --no-progress --- input/ffms.c | 9 +++++++-- input/input.h | 1 + x264.c | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/input/ffms.c b/input/ffms.c index 8e76e5a1..ebfdb686 100644 --- a/input/ffms.c +++ b/input/ffms.c @@ -85,8 +85,13 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c } if( !idx ) { - idx = FFMS_MakeIndex( psz_filename, 0, 0, NULL, NULL, 0, update_progress, &h->time, &e ); - fprintf( stderr, " \r" ); + if( opt->progress ) + { + idx = FFMS_MakeIndex( psz_filename, 0, 0, NULL, NULL, 0, update_progress, &h->time, &e ); + fprintf( stderr, " \r" ); + } + else + idx = FFMS_MakeIndex( psz_filename, 0, 0, NULL, NULL, 0, NULL, NULL, &e ); FAIL_IF_ERROR( !idx, "could not create index\n" ) if( opt->index_file && FFMS_WriteIndex( opt->index_file, idx, &e ) ) x264_cli_log( "ffms", X264_LOG_WARNING, "could not write index file\n" ); diff --git a/input/input.h b/input/input.h index c8008a6a..1a94e0cc 100644 --- a/input/input.h +++ b/input/input.h @@ -40,6 +40,7 @@ typedef struct int bit_depth; char *timebase; int seek; + int progress; } cli_input_opt_t; /* properties of the source given by the demuxer */ diff --git a/x264.c b/x264.c index 32eaa0e2..35695c29 100644 --- a/x264.c +++ b/x264.c @@ -269,6 +269,9 @@ int main( int argc, char **argv ) if( parse( argc, argv, ¶m, &opt ) < 0 ) ret = -1; + /* Restore title; it can be changed by input modules */ + SetConsoleTitle( originalCTitle ); + /* Control-C handler */ signal( SIGINT, sigint_handler ); @@ -1398,6 +1401,8 @@ generic_option: info.tff = param->b_tff; info.vfr = param->b_vfr_input; + input_opt.progress = opt->b_progress; + if( select_input( demuxer, demuxername, input_filename, &opt->hin, &info, &input_opt ) ) return -1; -- 2.39.2