aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2016-04-25 11:58:04 +0200
committerGravatar wm4 <wm4@nowhere>2016-04-25 12:23:37 +0200
commit46e49a37be8b2a8e48eb3143f9d6e7cc07de82e4 (patch)
tree4ecace2924064eb7cdc99b5bb57ae70907c6c7de
parentbb17df1f07cfc062fedee8946b476a14d6897920 (diff)
vd_lavc: make all hwdec callbacks optional
-rw-r--r--video/decode/vd_lavc.c4
1 files 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;