[x264-devel] Disable progress for FFMS input with --no-progress

Anton Mitrofanov git at videolan.org
Wed Apr 13 04:04:28 CEST 2011


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Apr  5 14:06:54 2011 +0400| [89d92e5b1a6eb727e31f203cb580ffa8edc69331] | committer: Jason Garrett-Glaser

Disable progress for FFMS input with --no-progress

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=89d92e5b1a6eb727e31f203cb580ffa8edc69331
---

 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 8e76e5a..ebfdb68 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 c8008a6..1a94e0c 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 08b998a..f2da8f7 100644
--- a/x264.c
+++ b/x264.c
@@ -269,6 +269,9 @@ int main( int argc, char **argv )
     if( parse( argc, argv, &param, &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;
 



More information about the x264-devel mailing list