Fix DXVA 2 regression on Windows

This commit is contained in:
Cameron Gutman
2018-08-02 22:28:59 -07:00
parent 624578f286
commit 0c18bcdd5e
3 changed files with 15 additions and 7 deletions

View File

@@ -60,6 +60,11 @@ FFmpegVideoDecoder::~FFmpegVideoDecoder()
reset();
}
IFFmpegRenderer* FFmpegVideoDecoder::getRenderer()
{
return m_Renderer;
}
void FFmpegVideoDecoder::reset()
{
// Drop any frames still queued to ensure
@@ -99,9 +104,6 @@ bool FFmpegVideoDecoder::completeInitialization(AVCodec* decoder, int videoForma
return false;
}
// Stash a pointer to this object in the context
m_VideoDecoderCtx->opaque = this;
// Always request low delay decoding
m_VideoDecoderCtx->flags |= AV_CODEC_FLAG_LOW_DELAY;
@@ -126,6 +128,10 @@ bool FFmpegVideoDecoder::completeInitialization(AVCodec* decoder, int videoForma
return false;
}
// Stash a pointer to this object in the context
SDL_assert(m_VideoDecoderCtx->opaque == nullptr);
m_VideoDecoderCtx->opaque = this;
int err = avcodec_open2(m_VideoDecoderCtx, decoder, nullptr);
if (err < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,