History

Merge pull request #1624 from huili2/au_data_check

change au_ready status and check au number

dongzha committed 11 years ago

Commit 091e5cb2 parents eeee1a2 c20e1c63 files · +43 −29Browse files

Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/core/src/decoder.cpp+29−25
@@ -642,23 +642,25 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 641 unmodified lines
642642 pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
643643 0; // set 4 reserved bytes to zero
644644 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
645− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
646− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
647− }
648− if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
649− iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
650− }
651− if (pCtx->bAuReadyFlag) {
652− ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
645+ if (pNalPayload) { //parse correct
646+ if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
647+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
648+ }
649+ if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
650+ iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
651+ }
652+ if (pCtx->bAuReadyFlag) {
653+ ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
653654
654− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
655+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
655656 #ifdef LONG_TERM_REF
656− pCtx->bParamSetsLostFlag = true;
657+ pCtx->bParamSetsLostFlag = true;
657658 #else
658− pCtx->bReferenceLostAtT0Flag = true;
659+ pCtx->bReferenceLostAtT0Flag = true;
659660 #endif
660− if (dsOutOfMemory & pCtx->iErrorCode) {
661− return pCtx->iErrorCode;
661+ if (dsOutOfMemory & pCtx->iErrorCode) {
662+ return pCtx->iErrorCode;
663+ }
662664 }
663665 }
664666 }
@@ -698,22 +700,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines
698700 pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
699701 0; // set 4 reserved bytes to zero
700702 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
701− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
702− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
703− }
704− if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
705− iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
706− }
707− if (pCtx->bAuReadyFlag) {
708− ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
703+ if (pNalPayload) { //parse correct
704+ if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
705+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
706+ }
707+ if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
708+ iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
709+ }
710+ if (pCtx->bAuReadyFlag) {
711+ ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
709712
710− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
713+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
711714 #ifdef LONG_TERM_REF
712− pCtx->bParamSetsLostFlag = true;
715+ pCtx->bParamSetsLostFlag = true;
713716 #else
714− pCtx->bReferenceLostAtT0Flag = true;
717+ pCtx->bReferenceLostAtT0Flag = true;
715718 #endif
716− return pCtx->iErrorCode;
719+ return pCtx->iErrorCode;
720+ }
717721 }
718722 }
719723 if (iRet) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t