diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2007-08-09 12:13:29 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-08-09 12:13:29 +0000 |
commit | aab1b7e56eac63be40e6a8454c1a4b8b644c495b (patch) | |
tree | 5bdfd22e0fb94dc08163414486dc8dd5fe0b9db0 /ffplay.c | |
parent | e999435a604766e858bb49c102f18484613ef626 (diff) | |
download | ffmpeg-aab1b7e56eac63be40e6a8454c1a4b8b644c495b.tar.gz |
Make ffmpeg and ffplay exit 0 after displaying help
patch by Stefano Sabatini [stefano sabatini minus lala at poste it]
Originally committed as revision 10012 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r-- | ffplay.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -2412,8 +2412,10 @@ static void opt_sync(const char *arg) av_sync_type = AV_SYNC_VIDEO_MASTER; else if (!strcmp(arg, "ext")) av_sync_type = AV_SYNC_EXTERNAL_CLOCK; - else + else { show_help(); + exit(1); + } } static void opt_seek(const char *arg) @@ -2440,8 +2442,14 @@ static void opt_thread_count(const char *arg) #endif } +static void opt_show_help(void) +{ + show_help(); + exit(0); +} + const OptionDef options[] = { - { "h", 0, {(void*)show_help}, "show help" }, + { "h", 0, {(void*)opt_show_help}, "show help" }, { "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" }, { "y", HAS_ARG, {(void*)opt_height}, "force displayed height", "height" }, { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" }, @@ -2499,7 +2507,6 @@ void show_help(void) "down/up seek backward/forward 1 minute\n" "mouse click seek to percentage in file corresponding to fraction of width\n" ); - exit(1); } void parse_arg_file(const char *filename) @@ -2519,8 +2526,10 @@ int main(int argc, char **argv) parse_options(argc, argv, options); - if (!input_filename) + if (!input_filename) { show_help(); + exit(1); + } if (display_disable) { video_disable = 1; |