[FFmpeg-devel] [PATCH] fftools: notify user of flags upon loglevel parse failure
Gyan Doshi
ffmpeg at gyani.pro
Fri Feb 21 14:04:10 EET 2025
On 2025-02-21 04:34 pm, Andreas Rheinhardt wrote:
> Gyan Doshi:
>>
>> On 2025-02-21 02:21 pm, Andreas Rheinhardt wrote:
>>> Gyan Doshi:
>>>> ---
>>>> fftools/opt_common.c | 5 +++++
>>>> 1 file changed, 5 insertions(+)
>>>>
>>>> diff --git a/fftools/opt_common.c b/fftools/opt_common.c
>>>> index 317e8458c1..2ac3fd4fb3 100644
>>>> --- a/fftools/opt_common.c
>>>> +++ b/fftools/opt_common.c
>>>> @@ -1330,6 +1330,11 @@ int opt_loglevel(void *optctx, const char
>>>> *opt, const char *arg)
>>>> "Possible levels are numbers or:\n", arg);
>>>> for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++)
>>>> av_log(NULL, AV_LOG_FATAL, "\"%s\"\n",
>>>> log_levels[i].name);
>>>> + av_log(NULL, AV_LOG_FATAL, "Possible flags are:\n");
>>>> + av_log(NULL, AV_LOG_FATAL, "\"repeat\"\n");
>>>> + av_log(NULL, AV_LOG_FATAL, "\"level\"\n");
>>>> + av_log(NULL, AV_LOG_FATAL, "\"time\"\n");
>>>> + av_log(NULL, AV_LOG_FATAL, "\"datetime\"\n");
>>>> return AVERROR(EINVAL);
>>>> }
>>>>
>>> This would all fit into one line.
>> Do you mean a single log call, or also printed on one line?
>> If the former, the remaining values will be misaligned with the first one.
>> If the latter, it's prettier with one value per line, just like the log
>> level values printed just above.
> I meant the latter. And I actually prefer the more compact form
> "repeat", "level", "time", "datetime" to the one-value-per-line form.
I think the per-line approach is visually clearer, so I'd like to keep
it as it is. You can submit a patch to reformat it if you like.
Regards,
Gyan
More information about the ffmpeg-devel
mailing list