diff options
author | Armada <jules.blok@gmail.com> | 2012-10-05 19:40:34 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2012-10-05 22:43:16 +0400 |
commit | fcb797043aa9d652df464ccb09e3e1be5efc034e (patch) | |
tree | f84baa905e9af6fd0b3fffba177e20cb3325cbcd /src/DSUtil/H264Nalu.cpp | |
parent | bb7e7cf4fedefc3e26781a661dea073adf50f93f (diff) |
H264Nalu: Removed usage of goto
Diffstat (limited to 'src/DSUtil/H264Nalu.cpp')
-rw-r--r-- | src/DSUtil/H264Nalu.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/DSUtil/H264Nalu.cpp b/src/DSUtil/H264Nalu.cpp index 8f9271a61..eab448e9e 100644 --- a/src/DSUtil/H264Nalu.cpp +++ b/src/DSUtil/H264Nalu.cpp @@ -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;
}
|