[FFmpeg-devel] [PATCH 1/2] lavc/libaomenc: Show encoder config as a warning in case of failed initialization
Thilo Borgmann
thilo.borgmann at mail.de
Mon Jun 14 21:13:42 EEST 2021
Am 14.06.21 um 20:10 schrieb Thilo Borgmann:
> Am 14.06.21 um 19:39 schrieb James Zern:
>> On Sat, Jun 12, 2021 at 12:10 PM Thilo Borgmann <thilo.borgmann at mail.de> wrote:
>>>
>>> Hi,
>>>
>>> if init fails, it's likely originating from the library's config. This and 2/2 are for easier debugging in that case instead of having to run again with loglevel DEBUG.
>>>
>>
>>> ---
>>> libavcodec/libaomenc.c | 10 ++++++----
>>> 1 file changed, 6 insertions(+), 4 deletions(-)
>>>
>>
>> lgtm.
>>
>>> [...]
>>> - dump_enc_cfg(avctx, &enccfg);
>>> /* Construct Encoder Context */
>>> res = aom_codec_enc_init(&ctx->encoder, iface, &enccfg, flags);
>>> if (res != AOM_CODEC_OK) {
>>> + dump_enc_cfg(avctx, &enccfg, AV_LOG_WARNING);
>>> log_encoder_error(avctx, "Failed to initialize encoder");
>>> return AVERROR(EINVAL);
>>> + } else {
>>
>> This else could be removed since the other branch returns.
>>
>>> + dump_enc_cfg(avctx, &enccfg, AV_LOG_DEBUG);
>>> }
>
> It would change existing behavior because currently, the cfg is always printed.
> If we make that change, it would not be printed at all in that case. Not?
Ah I misunderstood. OK will apply with that change :)
Thanks,
Thilo
More information about the ffmpeg-devel
mailing list