diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-07-06 00:56:13 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2017-07-06 00:56:13 +0300 |
commit | dd0a1490ab5b6387c339a98080a41de588c3d562 (patch) | |
tree | 824e7ca18c6de98a05546dc434932458831fe9e3 | |
parent | fe492a79579ae29d8bd037d32143ac3471998d6a (diff) |
dxva2: flush the decoder context when skipping a re-init
The flush is required to be able to re-start decoding on the same
context after an EndOfStream was issued to flush existing frames out.
-rw-r--r-- | decoder/LAVVideo/decoders/dxva2dec.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/decoder/LAVVideo/decoders/dxva2dec.cpp b/decoder/LAVVideo/decoders/dxva2dec.cpp index 20f709eb..cebfbdae 100644 --- a/decoder/LAVVideo/decoders/dxva2dec.cpp +++ b/decoder/LAVVideo/decoders/dxva2dec.cpp @@ -1029,6 +1029,9 @@ STDMETHODIMP CDecDXVA2::InitDecoder(AVCodecID codec, const CMediaType *pmt) if (mediaTypeCheck == *pmt) { DbgLog((LOG_TRACE, 10, L"-> Skipping re-init because media type is unchanged.")); m_MediaType = *pmt; + + // flush the decoder so we can resume decoding properly (before a re-init, EndOfStream would be called, making this necessary) + avcodec_flush_buffers(m_pAVCtx); return S_OK; } } |