From 17d6ba7f776d6fd0ebc7a9881a999299c3fa9471 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Dec 2016 18:40:17 +0100 Subject: vd_lavc: use AVFrame fields directly instead of AVCodecContext Conceptually cleaner, although the API claims this is equivalent. Originally, AVCodecContext fields were used, because not all supported libavcodec/libavutil versions had the AVFrame fields. This is not done for chroma_sample_location - it has no AVFrame field. --- video/decode/vd_lavc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 78d34bbb47..cc3bbc86c7 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -638,10 +638,10 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, .p_w = frame->sample_aspect_ratio.num, .p_h = frame->sample_aspect_ratio.den, .color = { - .space = avcol_spc_to_mp_csp(ctx->avctx->colorspace), - .levels = avcol_range_to_mp_csp_levels(ctx->avctx->color_range), - .primaries = avcol_pri_to_mp_csp_prim(ctx->avctx->color_primaries), - .gamma = avcol_trc_to_mp_csp_trc(ctx->avctx->color_trc), + .space = avcol_spc_to_mp_csp(frame->colorspace), + .levels = avcol_range_to_mp_csp_levels(frame->color_range), + .primaries = avcol_pri_to_mp_csp_prim(frame->color_primaries), + .gamma = avcol_trc_to_mp_csp_trc(frame->color_trc), .sig_peak = ctx->cached_hdr_peak, }, .chroma_location = -- cgit v1.2.3