summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-19 21:33:18 +0200
committerwm4 <wm4@nowhere>2015-08-19 21:33:18 +0200
commitbffd78748fb7fb1248424b1d4d2d67eb31c8762f (patch)
tree92e1038645675c95d6fffb85b3a78ee5c299ee24 /video/decode/vd_lavc.c
parentcab1f6439c201d877e709c45bb6a119feddc6a53 (diff)
downloadmpv-bffd78748fb7fb1248424b1d4d2d67eb31c8762f.tar.bz2
mpv-bffd78748fb7fb1248424b1d4d2d67eb31c8762f.tar.xz
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c13
1 files changed, 5 insertions, 8 deletions
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;