Merge commit '7c5012127fb7e18f0616011257bb4248f6a8b608'
* commit '7c5012127fb7e18f0616011257bb4248f6a8b608': cmdutils: change semantics of show_help_options() and document it. avtools: move some newlines to show_help_options(). avconv: deprecate -isync. Conflicts: ffmpeg_opt.c ffserver.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
30
cmdutils.c
30
cmdutils.c
@ -141,8 +141,8 @@ int64_t parse_time_or_die(const char *context, const char *timestr,
|
||||
return us;
|
||||
}
|
||||
|
||||
void show_help_options(const OptionDef *options, const char *msg, int mask,
|
||||
int value)
|
||||
void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
||||
int rej_flags)
|
||||
{
|
||||
const OptionDef *po;
|
||||
int first;
|
||||
@ -150,19 +150,23 @@ void show_help_options(const OptionDef *options, const char *msg, int mask,
|
||||
first = 1;
|
||||
for (po = options; po->name != NULL; po++) {
|
||||
char buf[64];
|
||||
if ((po->flags & mask) == value) {
|
||||
if (first) {
|
||||
printf("%s", msg);
|
||||
first = 0;
|
||||
}
|
||||
av_strlcpy(buf, po->name, sizeof(buf));
|
||||
if (po->flags & HAS_ARG) {
|
||||
av_strlcat(buf, " ", sizeof(buf));
|
||||
av_strlcat(buf, po->argname, sizeof(buf));
|
||||
}
|
||||
printf("-%-17s %s\n", buf, po->help);
|
||||
|
||||
if (((po->flags & req_flags) != req_flags) ||
|
||||
(po->flags & rej_flags))
|
||||
continue;
|
||||
|
||||
if (first) {
|
||||
printf("%s\n", msg);
|
||||
first = 0;
|
||||
}
|
||||
av_strlcpy(buf, po->name, sizeof(buf));
|
||||
if (po->flags & HAS_ARG) {
|
||||
av_strlcat(buf, " ", sizeof(buf));
|
||||
av_strlcat(buf, po->argname, sizeof(buf));
|
||||
}
|
||||
printf("-%-17s %s\n", buf, po->help);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
void show_help_children(const AVClass *class, int flags)
|
||||
|
Reference in New Issue
Block a user