patch by Stefano Sabatini [stefano sabatini minus lala at poste it] Originally committed as revision 10012 to svn://svn.ffmpeg.org/ffmpeg/trunktags/v0.5
| @@ -3332,6 +3332,12 @@ static void opt_intra_matrix(const char *arg) | |||||
| parse_matrix_coeffs(intra_matrix, arg); | parse_matrix_coeffs(intra_matrix, arg); | ||||
| } | } | ||||
| static void opt_show_help(void) | |||||
| { | |||||
| show_help(); | |||||
| exit(0); | |||||
| } | |||||
| static void opt_target(const char *arg) | static void opt_target(const char *arg) | ||||
| { | { | ||||
| int norm = -1; | int norm = -1; | ||||
| @@ -3585,7 +3591,7 @@ static int opt_default(const char *opt, const char *arg){ | |||||
| const OptionDef options[] = { | const OptionDef options[] = { | ||||
| /* main options */ | /* main options */ | ||||
| { "L", 0, {(void*)show_license}, "show license" }, | { "L", 0, {(void*)show_license}, "show license" }, | ||||
| { "h", 0, {(void*)show_help}, "show help" }, | |||||
| { "h", 0, {(void*)opt_show_help}, "show help" }, | |||||
| { "version", 0, {(void*)show_version}, "show version" }, | { "version", 0, {(void*)show_version}, "show version" }, | ||||
| { "formats", 0, {(void*)show_formats}, "show available formats, codecs, protocols, ..." }, | { "formats", 0, {(void*)show_formats}, "show available formats, codecs, protocols, ..." }, | ||||
| { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" }, | { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" }, | ||||
| @@ -3797,8 +3803,6 @@ static void show_help(void) | |||||
| av_opt_show(avctx_opts[0], NULL); | av_opt_show(avctx_opts[0], NULL); | ||||
| av_opt_show(avformat_opts, NULL); | av_opt_show(avformat_opts, NULL); | ||||
| av_opt_show(sws_opts, NULL); | av_opt_show(sws_opts, NULL); | ||||
| exit(1); | |||||
| } | } | ||||
| void parse_arg_file(const char *filename) | void parse_arg_file(const char *filename) | ||||
| @@ -3820,8 +3824,10 @@ int main(int argc, char **argv) | |||||
| sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL); | sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL); | ||||
| show_banner(); | show_banner(); | ||||
| if (argc <= 1) | |||||
| if (argc <= 1) { | |||||
| show_help(); | show_help(); | ||||
| exit(1); | |||||
| } | |||||
| /* parse options */ | /* parse options */ | ||||
| parse_options(argc, argv, options); | parse_options(argc, argv, options); | ||||
| @@ -2412,8 +2412,10 @@ static void opt_sync(const char *arg) | |||||
| av_sync_type = AV_SYNC_VIDEO_MASTER; | av_sync_type = AV_SYNC_VIDEO_MASTER; | ||||
| else if (!strcmp(arg, "ext")) | else if (!strcmp(arg, "ext")) | ||||
| av_sync_type = AV_SYNC_EXTERNAL_CLOCK; | av_sync_type = AV_SYNC_EXTERNAL_CLOCK; | ||||
| else | |||||
| else { | |||||
| show_help(); | show_help(); | ||||
| exit(1); | |||||
| } | |||||
| } | } | ||||
| static void opt_seek(const char *arg) | static void opt_seek(const char *arg) | ||||
| @@ -2440,8 +2442,14 @@ static void opt_thread_count(const char *arg) | |||||
| #endif | #endif | ||||
| } | } | ||||
| static void opt_show_help(void) | |||||
| { | |||||
| show_help(); | |||||
| exit(0); | |||||
| } | |||||
| const OptionDef options[] = { | 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" }, | { "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" }, | ||||
| { "y", HAS_ARG, {(void*)opt_height}, "force displayed height", "height" }, | { "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" }, | { "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" | "down/up seek backward/forward 1 minute\n" | ||||
| "mouse click seek to percentage in file corresponding to fraction of width\n" | "mouse click seek to percentage in file corresponding to fraction of width\n" | ||||
| ); | ); | ||||
| exit(1); | |||||
| } | } | ||||
| void parse_arg_file(const char *filename) | void parse_arg_file(const char *filename) | ||||
| @@ -2519,8 +2526,10 @@ int main(int argc, char **argv) | |||||
| parse_options(argc, argv, options); | parse_options(argc, argv, options); | ||||
| if (!input_filename) | |||||
| if (!input_filename) { | |||||
| show_help(); | show_help(); | ||||
| exit(1); | |||||
| } | |||||
| if (display_disable) { | if (display_disable) { | ||||
| video_disable = 1; | video_disable = 1; | ||||