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/lavc.h | 1 - video/decode/vd_lavc.c | 17 +++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/video/decode/lavc.h b/video/decode/lavc.h index e9174302b9..9ef74668d8 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -19,7 +19,6 @@ typedef struct lavc_ctx { struct vd_lavc_hwdec *hwdec; AVRational codec_timebase; enum AVPixelFormat pix_fmt; - int best_csp; enum AVDiscard skip_frame; bool flushing; const char *decoder; 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