diff options
author | Matthieu Patou <mpatou@fb.com> | 2021-06-14 20:20:52 +0200 |
---|---|---|
committer | Thilo Borgmann <thilo.borgmann@mail.de> | 2021-06-14 20:25:56 +0200 |
commit | fcb80aa289a5339353ca9b1f5b2591d0e6cc5f19 (patch) | |
tree | 50e9cfa9137e13c5e9d01a09d0b54ed7b8af9fd6 /libavcodec | |
parent | 268f134e51e59581cd5951fb4cc9f80c6cba8094 (diff) |
lavc/libvpxenc: Show encoder config as a warning in case of failed initialization
Suggested-By: ffmpeg@fb.com
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libvpxenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 66bad444d0..94932a48da 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -190,10 +190,10 @@ static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc) } static av_cold void dump_enc_cfg(AVCodecContext *avctx, - const struct vpx_codec_enc_cfg *cfg) + const struct vpx_codec_enc_cfg *cfg, + int level) { int width = -30; - int level = AV_LOG_DEBUG; int i; av_log(avctx, level, "vpx_codec_enc_cfg\n"); @@ -860,7 +860,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, return AVERROR(EINVAL); } - dump_enc_cfg(avctx, &enccfg); + dump_enc_cfg(avctx, &enccfg, AV_LOG_DEBUG); enccfg.g_w = avctx->width; enccfg.g_h = avctx->height; @@ -1004,13 +1004,15 @@ static av_cold int vpx_init(AVCodecContext *avctx, en->key, en->value); } - dump_enc_cfg(avctx, &enccfg); /* Construct Encoder Context */ res = vpx_codec_enc_init(&ctx->encoder, iface, &enccfg, flags); if (res != VPX_CODEC_OK) { + dump_enc_cfg(avctx, &enccfg, AV_LOG_WARNING); log_encoder_error(avctx, "Failed to initialize encoder"); return AVERROR(EINVAL); } + dump_enc_cfg(avctx, &enccfg, AV_LOG_DEBUG); + #if CONFIG_LIBVPX_VP9_ENCODER if (avctx->codec_id == AV_CODEC_ID_VP9 && enccfg.ts_number_layers > 1) { memset(&svc_params, 0, sizeof(svc_params)); |