From a38f313bcc30ce0f2604a579804271732f192f39 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 3 Feb 2016 21:31:53 +0100 Subject: vd_lavc: remove redundant best_csp field And some other simplifications. --- video/decode/vd_lavc.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 64c71afd02..19b335d037 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -511,22 +511,11 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, { vd_ffmpeg_ctx *ctx = vd->priv; struct MPOpts *opts = ctx->opts; - int width = frame->width; - int height = frame->height; - int pix_fmt = frame->format; - - if (pix_fmt != ctx->pix_fmt) { - ctx->pix_fmt = pix_fmt; - ctx->best_csp = pixfmt2imgfmt(pix_fmt); - if (!ctx->best_csp) - MP_ERR(vd, "lavc pixel format %s not supported.\n", - av_get_pix_fmt_name(pix_fmt)); - } *out_params = (struct mp_image_params) { - .imgfmt = ctx->best_csp, - .w = width, - .h = height, + .imgfmt = pixfmt2imgfmt(frame->format), + .w = frame->width, + .h = frame->height, .p_w = frame->sample_aspect_ratio.num, .p_h = frame->sample_aspect_ratio.den, .colorspace = avcol_spc_to_mp_csp(ctx->avctx->colorspace), -- cgit v1.2.3