diff options
author | CrystalP <CrystalP@xbmc.org> | 2012-04-29 14:44:20 -0400 |
---|---|---|
committer | CrystalP <CrystalP@xbmc.org> | 2012-04-29 14:58:03 -0400 |
commit | 0944dbc8f47bc0661130c60790e2973f5b0b839a (patch) | |
tree | e64f38a798e0912e4eb8ad65cadce59b6fc125c1 | |
parent | d2ac4545561cfb4fc7094f1ef121ff11501f7129 (diff) |
[WIN] fix endless loop with DXVA when refs increase mid-stream (handles
Previous code correctly closed the decoder, but kept closing it instead
recreating on next pass in Check()
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp index 0961eff5be..cafcd648b1 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp @@ -743,6 +743,19 @@ int CDecoder::Check(AVCodecContext* avctx) } } + if(m_format.SampleWidth == 0 + || m_format.SampleHeight == 0) + { + if(!Open(avctx, avctx->pix_fmt, m_shared)) + { + CLog::Log(LOGERROR, "CDecoder::Check - decoder was not able to reset"); + Close(); + return VC_ERROR; + } + return VC_FLUSHED; + } + else + { if(avctx->refs > m_refs) { CLog::Log(LOGWARNING, "CDecoder::Check - number of required reference frames increased, recreating decoder"); @@ -754,17 +767,6 @@ int CDecoder::Check(AVCodecContext* avctx) return VC_FLUSHED; #endif } - - if(m_format.SampleWidth == 0 - || m_format.SampleHeight == 0) - { - if(!Open(avctx, avctx->pix_fmt, m_shared)) - { - CLog::Log(LOGERROR, "CDecoder::Check - decoder was not able to reset"); - Close(); - return VC_ERROR; - } - return VC_FLUSHED; } // Status reports are available only for the DXVA2_ModeH264 and DXVA2_ModeVC1 modes |