diff options
Diffstat (limited to 'libavcodec/dxva2.c')
-rw-r--r-- | libavcodec/dxva2.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index f68df860dc..e168233402 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -42,8 +42,18 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, unsigned i; for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) - if (DXVA_CONTEXT_SURFACE(avctx, ctx, i) == surface) +#if CONFIG_D3D11VA + if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD && ctx->d3d11va.surface[i] == surface) + { + D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc; + ID3D11VideoDecoderOutputView_GetDesc(ctx->d3d11va.surface[i], &viewDesc); + return viewDesc.Texture2D.ArraySlice; + } +#endif +#if CONFIG_DXVA2 + if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface) return i; +#endif assert(0); return 0; |