From 49c9d2482d1dd5f9f7de2e51fdbfb2c71309c60b Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 22 May 2024 15:38:08 +0200 Subject: [PATCH] vcomp/lavc: codec opts printout fix When help was not present but default value yes, it was printed without a delimiter (" - ") after the option. --- src/video_compress/libavcodec.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 6373af299..509348ce0 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -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++; }