Skip to content

Commit

Permalink
vcomp/lavc: codec opts printout fix
Browse files Browse the repository at this point in the history
When help was not present but default value yes, it was printed without
a delimiter (" - ") after the option.
  • Loading branch information
MartinPulec committed May 23, 2024
1 parent 89eb7f4 commit 49c9d24
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/video_compress/libavcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1977,15 +1977,18 @@ void show_encoder_help(string const &name) {
}
string help_str;
if (opt->help != nullptr && strlen(opt->help) > 0) {
help_str = " - "s + opt->help;
if (!default_val.empty()) {
if (strstr(opt->help, "default") == nullptr) {
help_str += ", ";
} else {
default_val = "";
}
help_str = opt->help;
}
if (!default_val.empty()) {
if (help_str.find("default") == 0) {
default_val = "";
} else if (!help_str.empty()) {
help_str += ", ";
}
}
if (!help_str.empty() || !default_val.empty()) {
help_str = " - "s + help_str;
}
col() << indent << SBOLD(opt->name) << help_str << default_val << "\n";
opt++;
}
Expand Down

0 comments on commit 49c9d24

Please sign in to comment.