diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 0e50fbfd7c..f66345e998 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -385,9 +385,20 @@ static av_cold int codecctl_int(AVCodecContext *avctx, snprintf(buf, sizeof(buf), "Failed to set %s codec control", ctlidstr[id]); log_encoder_error(avctx, buf); + return AVERROR(EINVAL); } - return res == VPX_CODEC_OK ? 0 : AVERROR(EINVAL); + if (ctx->is_alpha) { + int res_alpha = vpx_codec_control(&ctx->encoder_alpha, id, val); + if (res_alpha != VPX_CODEC_OK) { + snprintf(buf, sizeof(buf), "Failed to set %s alpha codec control", + ctlidstr[id]); + log_encoder_error(avctx, buf); + return AVERROR(EINVAL); + } + } + + return 0; } #if VPX_ENCODER_ABI_VERSION >= 12 @@ -407,9 +418,20 @@ static av_cold int codecctl_intp(AVCodecContext *avctx, snprintf(buf, sizeof(buf), "Failed to set %s codec control", ctlidstr[id]); log_encoder_error(avctx, buf); + return AVERROR(EINVAL); } - return res == VPX_CODEC_OK ? 0 : AVERROR(EINVAL); + if (ctx->is_alpha) { + int res_alpha = vpx_codec_control(&ctx->encoder_alpha, id, val); + if (res_alpha != VPX_CODEC_OK) { + snprintf(buf, sizeof(buf), "Failed to set %s alpha codec control", + ctlidstr[id]); + log_encoder_error(avctx, buf); + return AVERROR(EINVAL); + } + } + + return 0; } #endif diff --git a/libavcodec/version.h b/libavcodec/version.h index 83db2b242a..4b4fe543ab 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 59 #define LIBAVCODEC_VERSION_MINOR 7 -#define LIBAVCODEC_VERSION_MICRO 102 +#define LIBAVCODEC_VERSION_MICRO 103 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \