[FFmpeg-devel] [PATCH 1/2] lavc/libaomenc: Show encoder config as a warning in case of failed initialization
    James Zern 
    jzern at google.com
       
    Mon Jun 14 20:39:11 EEST 2021
    
    
  
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);
>      }
>
    
    
More information about the ffmpeg-devel
mailing list