Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
H264Nalu: Removed usage of goto
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR authored and XhmikosR committed Oct 5, 2012
1 parent bb7e7cf commit fcb7970
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/DSUtil/H264Nalu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,18 @@ void CH264Nalu::SetBuffer(const BYTE* pBuffer, size_t nSize, int nNALSize)

bool CH264Nalu::MoveToNextAnnexBStartcode()
{
if (m_nSize < 4) {
goto notfound;
}

size_t nBuffEnd = m_nSize - 4;

for (size_t i = m_nCurPos; i <= nBuffEnd; i++) {
if ((*((DWORD*)(m_pBuffer + i)) & 0x00FFFFFF) == 0x00010000) {
// Found next AnnexB NAL
m_nCurPos = i;
return true;
if (m_nSize >= 4) {
size_t nBuffEnd = m_nSize - 4;

for (size_t i = m_nCurPos; i <= nBuffEnd; i++) {
if ((*((DWORD*)(m_pBuffer + i)) & 0x00FFFFFF) == 0x00010000) {
// Found next AnnexB NAL
m_nCurPos = i;
return true;
}
}
}

notfound:
m_nCurPos = m_nSize;
return false;
}
Expand Down

0 comments on commit fcb7970

Please sign in to comment.