summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vaapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/decode/vaapi.c b/video/decode/vaapi.c
index d1099dabf5..8d7af19bfa 100644
--- a/video/decode/vaapi.c
+++ b/video/decode/vaapi.c
@@ -80,6 +80,9 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h)
fctx->initial_pool_size = hwdec_get_max_refs(ctx) + ADDITIONAL_SURFACES;
+ // Some mpv downstream code uses this.
+ fctx->user_opaque = p->ctx;
+
va_lock(p->ctx);
int res = av_hwframe_ctx_init(p->frames_ref);
va_unlock(p->ctx);
@@ -151,9 +154,6 @@ static int init(struct lavc_ctx *ctx, bool direct)
vactx->display = p->ctx->display;
- // Some mpv downstream code uses this.
- hwctx->user_opaque = p->ctx;
-
if (av_hwdevice_ctx_init(p->device_ref) < 0)
return -1;