From 46e49a37be8b2a8e48eb3143f9d6e7cc07de82e4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Apr 2016 11:58:04 +0200 Subject: vd_lavc: make all hwdec callbacks optional --- video/decode/vd_lavc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index c1e3c021f2..dc8c896aa5 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -458,7 +458,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder, avctx->get_format = get_format_hwdec; if (ctx->hwdec->allocate_image) avctx->get_buffer2 = get_buffer2_hwdec; - if (ctx->hwdec->init(ctx) < 0) + if (ctx->hwdec->init && ctx->hwdec->init(ctx) < 0) goto error; ctx->max_delay_queue = ctx->hwdec->delay_queue; } else { @@ -626,7 +626,7 @@ 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 (change) { + if (change && ctx->hwdec->init_decoder) { if (ctx->hwdec->init_decoder(ctx, ctx->hwdec_w, ctx->hwdec_h) < 0) { ctx->hwdec_fmt = 0; -- cgit v1.2.3