avcodec/libx264: fix usage of AVComponentDescriptor depth field release/2.4
authorJames Almer <jamrial@gmail.com>
Thu, 1 Feb 2018 01:38:50 +0000 (22:38 -0300)
committerJames Almer <jamrial@gmail.com>
Thu, 1 Feb 2018 01:39:53 +0000 (22:39 -0300)
AVComponentDescriptor.depth is not available in release/2.4

This fixes compilation of the libx264 wrapper.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/libx264.c

index 72427d3..97fc62f 100644 (file)
@@ -398,7 +398,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
     x4->params.i_log_level          = X264_LOG_DEBUG;
     x4->params.i_csp                = convert_pix_fmt(avctx->pix_fmt);
 #if X264_BUILD >= 153
-    x4->params.i_bitdepth           = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth;
+    x4->params.i_bitdepth           = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
 #endif
 
     OPT_STR("weightp", x4->wpredp);