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
108}108}
109 109
110void show_help_options(const OptionDef *options, const char *msg, int req_flags,110void show_help_options(const OptionDef *options, const char *msg, int req_flags,
111 int rej_flags, int alt_flags)111 int rej_flags)
112{112{
113 const OptionDef *po;113 const OptionDef *po;
114 int first;114 int first;
@@ -118,7 +118,6 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags, · 3 unmodified lines
118 char buf[128];118 char buf[128];
119 119
120 if (((po->flags & req_flags) != req_flags) ||120 if (((po->flags & req_flags) != req_flags) ||
121 (alt_flags && !(po->flags & alt_flags)) ||
122 (po->flags & rej_flags))121 (po->flags & rej_flags))
123 continue;122 continue;
124 123
fftools/cmdutils.h+1−2
@@ -200,10 +200,9 @@ typedef struct OptionDef { · 199 unmodified lines
200 * @param msg title of this group. Only printed if at least one option matches.200 * @param msg title of this group. Only printed if at least one option matches.
201 * @param req_flags print only options which have all those flags set.201 * @param req_flags print only options which have all those flags set.
202 * @param rej_flags don't print options which have any of those flags set.202 * @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
204 */203 */
205void show_help_options(const OptionDef *options, const char *msg, int req_flags,204void show_help_options(const OptionDef *options, const char *msg, int req_flags,
206 int rej_flags, int alt_flags);205 int rej_flags);
207 206
208/**207/**
209 * Show help for all options with given flags in class and all its208 * 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
1198 "\n", program_name);1198 "\n", program_name);
1199 1199
1200 show_help_options(options, "Print help / information / capabilities:",1200 show_help_options(options, "Print help / information / capabilities:",
1201 OPT_EXIT, OPT_EXPERT, 0);1201 OPT_EXIT, OPT_EXPERT);
1202 if (show_advanced)1202 if (show_advanced)
1203 show_help_options(options, "Advanced information / capabilities:",1203 show_help_options(options, "Advanced information / capabilities:",
1204 OPT_EXIT | OPT_EXPERT, 0, 0);1204 OPT_EXIT | OPT_EXPERT, 0);
1205 1205
1206 show_help_options(options, "Global options (affect whole program "1206 show_help_options(options, "Global options (affect whole program "
1207 "instead of just one file):",1207 "instead of just one file):",
1208 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT, 0);1208 0, OPT_PERFILE | OPT_EXIT | OPT_EXPERT);
1209 if (show_advanced)1209 if (show_advanced)
1210 show_help_options(options, "Advanced global options:", OPT_EXPERT,1210 show_help_options(options, "Advanced global options:", OPT_EXPERT,
1211 OPT_PERFILE | OPT_EXIT, 0);1211 OPT_PERFILE | OPT_EXIT);
1212 1212
1213 show_help_options(options, "Per-file main options:", 0,1213 show_help_options(options, "Per-file main options:", OPT_PERFILE,
1214 OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA |1214 OPT_EXPERT | OPT_AUDIO | OPT_VIDEO | OPT_SUBTITLE | OPT_DATA |
1215 OPT_EXIT, OPT_PERFILE);1215 OPT_EXIT);
1216 if (show_advanced)1216 if (show_advanced)
1217 show_help_options(options, "Advanced per-file options:",1217 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);
1219 1219
1220 show_help_options(options, "Video options:",1220 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);
1222 if (show_advanced)1222 if (show_advanced)
1223 show_help_options(options, "Advanced Video options:",1223 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);
1225 1225
1226 show_help_options(options, "Audio options:",1226 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);
1228 if (show_advanced)1228 if (show_advanced)
1229 show_help_options(options, "Advanced Audio options:",1229 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);
1231 1231
1232 show_help_options(options, "Subtitle options:",1232 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);
1234 if (show_advanced)1234 if (show_advanced)
1235 show_help_options(options, "Advanced Subtitle options:",1235 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);
1237 1237
1238 if (show_advanced)1238 if (show_advanced)
1239 show_help_options(options, "Data stream options:",1239 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);
1241 printf("\n");1241 printf("\n");
1242 1242
1243 if (show_avoptions) {1243 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
3705{3705{
3706 av_log_set_callback(log_callback_help);3706 av_log_set_callback(log_callback_help);
3707 show_usage();3707 show_usage();
3708 show_help_options(options, "Main options:", 0, OPT_EXPERT, 0);3708 show_help_options(options, "Main options:", 0, OPT_EXPERT);
3709 show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0);3709 show_help_options(options, "Advanced options:", OPT_EXPERT, 0);
3710 printf("\n");3710 printf("\n");
3711 show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);3711 show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM);
3712 show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);3712 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
3869{3869{
3870 av_log_set_callback(log_callback_help);3870 av_log_set_callback(log_callback_help);
3871 show_usage();3871 show_usage();
3872 show_help_options(options, "Main options:", 0, 0, 0);3872 show_help_options(options, "Main options:", 0, 0);
3873 printf("\n");3873 printf("\n");
3874 3874
3875 show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);3875 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