Skip to content

Commit

Permalink
change skip_bytes size type from int64_t to uint64_t (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
iwashiira authored Apr 3, 2024
1 parent b99bb46 commit af07024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tsMuxer/ioContextDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,17 @@ unsigned IOContextDemuxer::get_buffer(uint8_t* binary, unsigned size)
return static_cast<uint32_t>(dst - binary);
}

void IOContextDemuxer::skip_bytes(const int64_t size)
void IOContextDemuxer::skip_bytes(const uint64_t size)
{
if (size == 0)
return;
uint32_t readedBytes = 0;
int readRez = 0;
int64_t skipLeft = size;
uint64_t skipLeft = size;

if (m_curPos < m_bufEnd)
{
const int64_t copyLen = min(m_bufEnd - m_curPos, skipLeft);
const uint64_t copyLen = min((uint64_t)(m_bufEnd - m_curPos), skipLeft);
skipLeft -= copyLen;
m_curPos += copyLen;
m_processedBytes += copyLen;
Expand All @@ -150,7 +150,7 @@ void IOContextDemuxer::skip_bytes(const int64_t size)
m_bufEnd = m_curPos + readedBytes;
if (readedBytes == 0)
break;
const int64_t copyLen = min(readedBytes, skipLeft);
const uint64_t copyLen = min((uint64_t)readedBytes, skipLeft);
m_curPos += copyLen;
m_processedBytes += copyLen;
skipLeft -= copyLen;
Expand Down
2 changes: 1 addition & 1 deletion tsMuxer/ioContextDemuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class IOContextDemuxer : public AbstractDemuxer
int64_t m_processedBytes;
int64_t m_lastProcessedBytes;

void skip_bytes(int64_t size);
void skip_bytes(uint64_t size);
unsigned get_buffer(uint8_t* binary, unsigned size);
bool url_fseek(int64_t offset);
int64_t get_be64();
Expand Down

0 comments on commit af07024

Please sign in to comment.