Allow a video end a couple packets from end.

Fixes #2206, Patapon 3.  Possibly we don't even need this check at all,
but I'm not sure.
This commit is contained in:
Unknown W. Brackets 2013-06-10 23:18:36 -07:00
parent 4cbd44a6ca
commit 2ce4cd245f

View file

@ -399,7 +399,9 @@ bool MediaEngine::stepVideo(int videoPixelMode) {
bGetFrame = true;
}
if (result <= 0 && dataEnd) {
m_isVideoEnd = !bGetFrame && m_readSize >= m_streamSize;
// Sometimes, m_readSize is less than m_streamSize at the end, but not by much.
// This is kinda a hack, but the ringbuffer would have to be prematurely empty too.
m_isVideoEnd = !bGetFrame && m_readSize >= (m_streamSize - 4096);
if (m_isVideoEnd)
m_decodedPos = m_readSize;
break;