aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/decode
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-02-03 21:31:53 +0100
committerGravatar wm4 <wm4@nowhere>2016-02-03 21:31:53 +0100
commita38f313bcc30ce0f2604a579804271732f192f39 (patch)
treedbf2998cb344a52c2c21191f9bd6319be6141cac /video/decode
parent1b6a191ea3ba4af3c89db98419b5eae899fedcb9 (diff)
vd_lavc: remove redundant best_csp field
And some other simplifications.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/lavc.h1
-rw-r--r--video/decode/vd_lavc.c17
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),