diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-05 20:39:08 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-08-11 19:43:16 +0300 |
commit | c43d7bd2ed320a0c9c21a78d77d159fd5038575a (patch) | |
tree | d889c9a2fbbc7215effcd874cfa84f441cb452ec | |
parent | a66dbc48dd92659e2139758e98985bbf560aec88 (diff) |
dxva2: support using D3D11 hwaccel with the old API
-rw-r--r-- | libavcodec/dxva2.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index afcd361ef6..9068387e3d 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -753,14 +753,13 @@ static void *get_surface(const AVCodecContext *avctx, const AVFrame *frame) { #if CONFIG_D3D11VA if (frame->format == AV_PIX_FMT_D3D11) { - FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx); + AVDXVAContext *ctx = DXVA_CONTEXT(avctx); intptr_t index = (intptr_t)frame->data[1]; - if (index < 0 || index >= sctx->nb_d3d11_views || - sctx->d3d11_texture != (ID3D11Texture2D *)frame->data[0]) { + if (index < 0 || index >= D3D11VA_CONTEXT(ctx)->surface_count) { av_log((void *)avctx, AV_LOG_ERROR, "get_buffer frame is invalid!\n"); return NULL; } - return sctx->d3d11_views[index]; + return D3D11VA_CONTEXT(ctx)->surface[index]; } #endif return frame->data[3]; |