diff --git a/tsMuxer/ioContextDemuxer.cpp b/tsMuxer/ioContextDemuxer.cpp index 0f333c14..7a2051b2 100644 --- a/tsMuxer/ioContextDemuxer.cpp +++ b/tsMuxer/ioContextDemuxer.cpp @@ -133,15 +133,14 @@ void IOContextDemuxer::skip_bytes(const int64_t size) m_curPos += copyLen; m_processedBytes += copyLen; } - - if (skipLeft > 2LL * m_fileBlockSize) + + while (skipLeft > 4LL * m_fileBlockSize) { - const int64_t offset = skipLeft - 2LL * m_fileBlockSize; m_bufferedReader->seek(m_readerID, m_fileBlockSize); - m_processedBytes += offset; - skipLeft = 2LL * m_fileBlockSize; + m_processedBytes += m_fileBlockSize; + skipLeft -= m_fileBlockSize; } - + while (skipLeft > 0) { uint8_t* data = m_bufferedReader->readBlock(m_readerID, readedBytes, readRez);