diff options
author | wm4 <wm4@nowhere> | 2017-01-12 09:21:58 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-12 13:58:28 +0100 |
commit | a51e991b564113254d9262565ddb69e40e2fd726 (patch) | |
tree | 039b47762bab42791e5d7b4c3cce83c22825e8d5 /video/decode | |
parent | fcb970492ccb5f351f4dce7ba52aefd38f544fe9 (diff) | |
download | mpv-a51e991b564113254d9262565ddb69e40e2fd726.tar.bz2 mpv-a51e991b564113254d9262565ddb69e40e2fd726.tar.xz |
vaapi: set our own context in AVHWFramesContext not AVHWDeviceContext
AVHWDeviceContext.user_opaque is reserved to libavutil under certain
circumstances, while AVHWFramesContext.user_opaque is truly free for use
by us. It's slightly simpler too.
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vaapi.c | 6 |
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; |