aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-12-25 19:40:42 -0300
committerJames Almer <jamrial@gmail.com>2017-12-26 12:55:54 -0300
commit31d6f3df25eea5bece145ad01f8a089a3005ca84 (patch)
treef08b679ffba2ad335c44f6cc6c92b441f465a8e2
parentbc839fb39dc376d462856863de2933f0b6b0351a (diff)
downloadffmpeg-31d6f3df25eea5bece145ad01f8a089a3005ca84.tar.gz
avcodec/libx264: use the pixfmt descriptor to check for high bit depths
The x264_bit_depth constant has been removed in newer x264 builds. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 89f704cabab446afc8ba6ecea76714a51b1df32b)
-rw-r--r--libavcodec/libx264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index b11ede6198..6764c045e7 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -272,6 +272,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
int *got_packet)
{
X264Context *x4 = ctx->priv_data;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(ctx->pix_fmt);
x264_nal_t *nal;
int nnal, i, ret;
x264_picture_t pic_out = {0};
@@ -279,7 +280,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_picture_init( &x4->pic );
x4->pic.img.i_csp = x4->params.i_csp;
- if (x264_bit_depth > 8)
+ if (desc->comp[0].depth > 8)
x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);