summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index d067b15401..d15f01768b 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -591,8 +591,13 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
ctx->hwdec_dev = hwdec_create_dev(vd, ctx->hwdec, false);
if (!ctx->hwdec_dev)
goto error;
- if (!ctx->hwdec->set_hwframes)
+ if (!ctx->hwdec->set_hwframes) {
+#if HAVE_VDPAU_HWACCEL
avctx->hw_device_ctx = av_buffer_ref(ctx->hwdec_dev->av_device_ref);
+#else
+ goto error;
+#endif
+ }
}
ctx->max_delay_queue = ctx->hwdec->delay_queue;
ctx->hw_probing = true;