libvpxenc: Don't spam level errors for VP8 encodes

Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
implement requested capability" log messages on VP8 encodes.
This commit is contained in:
Alex Converse 2016-12-12 12:07:05 -08:00
parent 6a8c0d8357
commit bf15981b12
1 changed files with 2 additions and 1 deletions

View File

@ -293,7 +293,8 @@ static av_cold int vpx_free(AVCodecContext *avctx)
VPxContext *ctx = avctx->priv_data;
#if VPX_ENCODER_ABI_VERSION >= 12
if (ctx->level >= 0 && !(avctx->flags & AV_CODEC_FLAG_PASS1)) {
if (avctx->codec_id == AV_CODEC_ID_VP9 && ctx->level >= 0 &&
!(avctx->flags & AV_CODEC_FLAG_PASS1)) {
int level_out = 0;
if (!codecctl_intp(avctx, VP9E_GET_LEVEL, &level_out))
av_log(avctx, AV_LOG_INFO, "Encoded level %.1f\n", level_out * 0.1);