aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Lhomme <robux4@gmail.com>2017-01-04 13:44:12 +0100
committerAnton Khirnov <anton@khirnov.net>2017-01-12 16:09:41 +0100
commitf67235a28cef44fcd97ae74ad53bbbc0d7f63d60 (patch)
tree4591a30bcbc5bc77f652e34560a95cdce319c005
parent122de16dd8108a59a55d30543c9f28b5f61b02d1 (diff)
downloadffmpeg-f67235a28cef44fcd97ae74ad53bbbc0d7f63d60.tar.gz
dxva2: get the slice number directly from the surface in D3D11VA
No need to loop through the known surfaces, we'll use the requested surface anyway. The loop is only done for DXVA2. Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/dxva2.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 6fc4f97d74..b0452b6a9a 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -41,19 +41,19 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,
void *surface = get_surface(frame);
unsigned i;
- for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {
#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;
- }
+ if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
+ D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC viewDesc;
+ ID3D11VideoDecoderOutputView_GetDesc((ID3D11VideoDecoderOutputView*) surface, &viewDesc);
+ return viewDesc.Texture2D.ArraySlice;
+ }
#endif
#if CONFIG_DXVA2
+ for (i = 0; i < DXVA_CONTEXT_COUNT(avctx, ctx); i++) {
if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD && ctx->dxva2.surface[i] == surface)
return i;
-#endif
}
+#endif
assert(0);
return 0;