From bffd78748fb7fb1248424b1d4d2d67eb31c8762f Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 19 Aug 2015 21:33:18 +0200 Subject: vd_lavc: remove unneeded hwdec parameters All hwdec backends now use a single pixel format, and the format is always checked. Also, the init_decoder callback is now mandatory. --- video/decode/vd_lavc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index b8042a007d..62fd0cebb7 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -529,9 +529,8 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx, ctx->hwdec_fmt = ctx->hwdec->image_format; ctx->hwdec_profile = avctx->profile; ctx->hwdec_request_reinit = false; - if (ctx->hwdec->init_decoder && change) { - if (ctx->hwdec->init_decoder(ctx, ctx->hwdec_fmt, - ctx->hwdec_w, ctx->hwdec_h) < 0) + if (change) { + if (ctx->hwdec->init_decoder(ctx, ctx->hwdec_w, ctx->hwdec_h) < 0) { ctx->hwdec_fmt = 0; break; @@ -580,12 +579,10 @@ static int get_buffer2_hwdec(AVCodecContext *avctx, AVFrame *pic, int flags) int w = pic->width; int h = pic->height; - if (ctx->hwdec->init_decoder) { - if (imgfmt != ctx->hwdec_fmt && w != ctx->hwdec_w && h != ctx->hwdec_h) - return -1; - } + if (imgfmt != ctx->hwdec_fmt && w != ctx->hwdec_w && h != ctx->hwdec_h) + return -1; - struct mp_image *mpi = ctx->hwdec->allocate_image(ctx, imgfmt, w, h); + struct mp_image *mpi = ctx->hwdec->allocate_image(ctx, w, h); if (!mpi) return -1; -- cgit v1.2.3