1
0
Fork 0

dxva2: support using D3D11 hwaccel with the old API

This commit is contained in:
Hendrik Leppkes 2017-08-05 19:39:08 +02:00
parent 0bc064a2db
commit 5e375fabf1
Signed by: hendrik
GPG Key ID: 846079A4B0A7C1B5
1 changed files with 3 additions and 4 deletions

View File

@ -754,14 +754,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];