History

change au_ready status and check au number

huili2 committed 11 years ago

Commit c20e1c61 parent 93265d73 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
@@ -626,23 +626,25 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 625 unmodified lines
626626 pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
627627 0; // set 4 reserved bytes to zero
628628 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
629− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
630− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
631− }
632− if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
633− iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
634− }
635− if (pCtx->bAuReadyFlag) {
636− ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
629+ if (pNalPayload) { //parse correct
630+ if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
631+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
632+ }
633+ if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
634+ iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
635+ }
636+ if (pCtx->bAuReadyFlag) {
637+ ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
637638
638− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
639+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
639640 #ifdef LONG_TERM_REF
640− pCtx->bParamSetsLostFlag = true;
641+ pCtx->bParamSetsLostFlag = true;
641642 #else
642− pCtx->bReferenceLostAtT0Flag = true;
643+ pCtx->bReferenceLostAtT0Flag = true;
643644 #endif
644− if (dsOutOfMemory & pCtx->iErrorCode) {
645− return pCtx->iErrorCode;
645+ if (dsOutOfMemory & pCtx->iErrorCode) {
646+ return pCtx->iErrorCode;
647+ }
646648 }
647649 }
648650 }
@@ -682,22 +684,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines
682684 pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] =
683685 0; // set 4 reserved bytes to zero
684686 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
685− if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
686− CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
687− }
688− if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
689− iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
690− }
691− if (pCtx->bAuReadyFlag) {
692− ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
687+ if (pNalPayload) { //parse correct
688+ if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) {
689+ CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo);
690+ }
691+ if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) {
692+ iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3);
693+ }
694+ if (pCtx->bAuReadyFlag) {
695+ ConstructAccessUnit (pCtx, ppDst, pDstBufInfo);
693696
694− if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
697+ if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) {
695698 #ifdef LONG_TERM_REF
696− pCtx->bParamSetsLostFlag = true;
699+ pCtx->bParamSetsLostFlag = true;
697700 #else
698− pCtx->bReferenceLostAtT0Flag = true;
701+ pCtx->bReferenceLostAtT0Flag = true;
699702 #endif
700− return pCtx->iErrorCode;
703+ return pCtx->iErrorCode;
704+ }
701705 }
702706 }
703707 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