Skip to content

Commit

Permalink
Fix skip_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed Oct 10, 2023
1 parent 1ca5ff2 commit 665acce
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tsMuxer/ioContextDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 665acce

Please sign in to comment.