shithub: openh264

Download patch

ref: 207082e23757a8d382ff723e1ffbbb93b206021c
parent: ac08cc4b2fcd087c9d56bd89a8092d582a9433fa
author: Haibo Zhu <haibozhu@cisco.com>
date: Tue Jan 6 12:48:58 EST 2015

Fix a bug when EC disable under delay mode (buf point not update when early exit)

--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -717,6 +717,7 @@
     iConsumedBytes = 0;
     pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
                          0; // set 4 reserved bytes to zero
+    pRawData->pCurPos = pDstNal + iDstIdx + 4; //init, increase 4 reserved zero bytes, used to store the next NAL
     pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
     if (pNalPayload) { //parse correct
       if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
@@ -749,7 +750,6 @@
       }
       return pCtx->iErrorCode;
     }
-    pRawData->pCurPos = pDstNal + iDstIdx + 4; //init, increase 4 reserved zero bytes, used to store the next NAL
   } else { /* no supplementary picture payload input, but stored a picture */
     PAccessUnit pCurAu	=
       pCtx->pAccessUnitList;	// current access unit, it will never point to NULL after decode's successful initialization