History

fftools/cmdutils: drop alt_flags parameter from show_help_options()

No user sets it to more than one flag, so it is redundant with req_flags.

Anton Khirnov committed 2 years ago

Commit 67529ad1 parent 03aedbd5 files · +19 −21Browse files

Unified · Split

5 files
  1. fftools/cmdutils.c +1 −2
  2. fftools/cmdutils.h +1 −2
  3. fftools/ffmpeg_opt.c +14 −14
  4. fftools/ffplay.c +2 −2
  5. fftools/ffprobe.c +1 −1
fftools/cmdutils.c+1−2
@@ -108,7 +108,7 @@ int parse_number(const char *context, const char *numstr, enum OptionType type, · 107 unmodified lines
108108 }
109109
110110 void show_help_options(const OptionDef *options, const char *msg, int req_flags,
111− int rej_flags, int alt_flags)
111+ int rej_flags)
112112 {
113113 const OptionDef *po;
114114 int first;
@@ -118,7 +118,6 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags, · 3 unmodified lines
118118 char buf[128];
119119
120120 if (((po->flags & req_flags) != req_flags) ||
121− (alt_flags && !(po->flags & alt_flags)) ||
122121 (po->flags & rej_flags))
123122 continue;
124123
fftools/cmdutils.h+1−2
@@ -200,10 +200,9 @@ typedef struct OptionDef { · 199 unmodified lines
200200 * @param msg title of this group. Only printed if at least one option matches.
201201 * @param req_flags print only options which have all those flags set.
202202 * @param rej_flags don't print options which have any of those flags set.
203− * @param alt_flags print only options that have at least one of those flags set
204203 */
205204 void show_help_options(const OptionDef *options, const char *msg, int req_flags,
206− int rej_flags, int alt_flags);
205+ int rej_flags);
207206
208207 /**
209208 * Show help for all options with given flags in class and all its
fftools/ffmpeg_opt.c+14−14
@@ -1198,46 +1198,46 @@ void show_help_default(const char *opt, const char *arg) · 1197 unmodified lines
11981198 "\n", program_name);
11991199
12001200 show_help_options(options, "Print help / information / capabilities:",
1201− OPT_EXIT, OPT_EXPERT, 0);
1201+ OPT_EXIT, OPT_EXPERT);
12021202 if (show_advanced)
12031203 show_help_options(options, "Advanced information / capabilities:",
1204− OPT_EXIT | OPT_EXPERT, 0, 0);
1204+ OPT_EXIT | OPT_EXPERT, 0);
12051205
12061206 show_help_options(options, "Global options (affect whole program "
12071207 "instead of just one file):",
1208− 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT, 0);
1208+ 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT);
12091209 if (show_advanced)
12101210 show_help_options(options, "Advanced global options:", OPT_EXPERT,
1211− OPT_PERFILE | OPT_EXIT, 0);
1211+ OPT_PERFILE | OPT_EXIT);
12121212
1213− show_help_options(options, "Per-file main options:", 0,
1213+ show_help_options(options, "Per-file main options:", OPT_PERFILE,
12141214 OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA |
1215− OPT_EXIT, OPT_PERFILE);
1215+ OPT_EXIT);
12161216 if (show_advanced)
12171217 show_help_options(options, "Advanced per-file options:",
1218− OPT_EXPERT, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE, OPT_PERFILE);
1218+ OPT_EXPERT | OPT_PERFILE, OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE);
12191219
12201220 show_help_options(options, "Video options:",
1221− OPT_VIDEO, OPT_EXPERT | OPT_AUDIO | OPT_SUBTITLE | OPT_DATA, 0);
1221+ OPT_VIDEO, OPT_EXPERT | OPT_AUDIO | OPT_SUBTITLE | OPT_DATA);
12221222 if (show_advanced)
12231223 show_help_options(options, "Advanced Video options:",
1224− OPT_EXPERT | OPT_VIDEO, OPT_AUDIO | OPT_SUBTITLE | OPT_DATA, 0);
1224+ OPT_EXPERT | OPT_VIDEO, OPT_AUDIO | OPT_SUBTITLE | OPT_DATA);
12251225
12261226 show_help_options(options, "Audio options:",
1227− OPT_AUDIO, OPT_EXPERT | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA, 0);
1227+ OPT_AUDIO, OPT_EXPERT | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA);
12281228 if (show_advanced)
12291229 show_help_options(options, "Advanced Audio options:",
1230− OPT_EXPERT | OPT_AUDIO, OPT_VIDEO | OPT_SUBTITLE | OPT_DATA, 0);
1230+ OPT_EXPERT | OPT_AUDIO, OPT_VIDEO | OPT_SUBTITLE | OPT_DATA);
12311231
12321232 show_help_options(options, "Subtitle options:",
1233− OPT_SUBTITLE, OPT_EXPERT | OPT_VIDEO | OPT_AUDIO | OPT_DATA, 0);
1233+ OPT_SUBTITLE, OPT_EXPERT | OPT_VIDEO | OPT_AUDIO | OPT_DATA);
12341234 if (show_advanced)
12351235 show_help_options(options, "Advanced Subtitle options:",
1236− OPT_EXPERT | OPT_SUBTITLE, OPT_VIDEO | OPT_AUDIO | OPT_DATA, 0);
1236+ OPT_EXPERT | OPT_SUBTITLE, OPT_VIDEO | OPT_AUDIO | OPT_DATA);
12371237
12381238 if (show_advanced)
12391239 show_help_options(options, "Data stream options:",
1240− OPT_DATA, OPT_VIDEO | OPT_AUDIO | OPT_SUBTITLE, 0);
1240+ OPT_DATA, OPT_VIDEO | OPT_AUDIO | OPT_SUBTITLE);
12411241 printf("\n");
12421242
12431243 if (show_avoptions) {
fftools/ffplay.c+2−2
@@ -3705,8 +3705,8 @@ void show_help_default(const char *opt, const char *arg) · 3704 unmodified lines
37053705 {
37063706 av_log_set_callback(log_callback_help);
37073707 show_usage();
3708− show_help_options(options, "Main options:", 0, OPT_EXPERT, 0);
3709− show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0);
3708+ show_help_options(options, "Main options:", 0, OPT_EXPERT);
3709+ show_help_options(options, "Advanced options:", OPT_EXPERT, 0);
37103710 printf("\n");
37113711 show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
37123712 show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
fftools/ffprobe.c+1−1
@@ -3869,7 +3869,7 @@ void show_help_default(const char *opt, const char *arg) · 3868 unmodified lines
38693869 {
38703870 av_log_set_callback(log_callback_help);
38713871 show_usage();
3872− show_help_options(options, "Main options:", 0, 0, 0);
3872+ show_help_options(options, "Main options:", 0, 0);
38733873 printf("\n");
38743874
38753875 show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t