change au_ready status and check au number
Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 3 files). Show all
Unified · Split
| @@ -642,23 +642,25 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 641 unmodified lines | |||
| 642 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = | 642 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 643 | 0; // set 4 reserved bytes to zero | 643 | 0; // set 4 reserved bytes to zero |
| 644 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 644 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 645 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | 645 | if (pNalPayload) { //parse correct |
| 646 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | 646 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { |
| 647 | } | 647 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); |
| 648 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | 648 | } |
| 649 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | 649 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 650 | } | 650 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 651 | if (pCtx->bAuReadyFlag) { | 651 | } |
| 652 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 652 | if (pCtx->bAuReadyFlag) { |
| 653 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | ||
| 653 | 654 | ||
| 654 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | 655 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { |
| 655 | #ifdef LONG_TERM_REF | 656 | #ifdef LONG_TERM_REF |
| 656 | pCtx->bParamSetsLostFlag = true; | 657 | pCtx->bParamSetsLostFlag = true; |
| 657 | #else | 658 | #else |
| 658 | pCtx->bReferenceLostAtT0Flag = true; | 659 | pCtx->bReferenceLostAtT0Flag = true; |
| 659 | #endif | 660 | #endif |
| 660 | if (dsOutOfMemory & pCtx->iErrorCode) { | 661 | if (dsOutOfMemory & pCtx->iErrorCode) { |
| 661 | return pCtx->iErrorCode; | 662 | return pCtx->iErrorCode; |
| 663 | } | ||
| 662 | } | 664 | } |
| 663 | } | 665 | } |
| 664 | } | 666 | } |
| @@ -698,22 +700,24 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 33 unmodified lines | |||
| 698 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = | 700 | pDstNal[iDstIdx] = pDstNal[iDstIdx + 1] = pDstNal[iDstIdx + 2] = pDstNal[iDstIdx + 3] = |
| 699 | 0; // set 4 reserved bytes to zero | 701 | 0; // set 4 reserved bytes to zero |
| 700 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); | 702 | pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes); |
| 701 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { | 703 | if (pNalPayload) { //parse correct |
| 702 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); | 704 | if (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1)) { |
| 703 | } | 705 | CheckAndFinishLastPic (pCtx, ppDst, pDstBufInfo); |
| 704 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) { | 706 | } |
| 705 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); | 707 | if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType)) { |
| 706 | } | 708 | iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes, pSrcNal - 3, iSrcIdx + 3); |
| 707 | if (pCtx->bAuReadyFlag) { | 709 | } |
| 708 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | 710 | if (pCtx->bAuReadyFlag) { |
| 711 | ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); | ||
| 709 | 712 | ||
| 710 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { | 713 | if ((dsOutOfMemory | dsNoParamSets) & pCtx->iErrorCode) { |
| 711 | #ifdef LONG_TERM_REF | 714 | #ifdef LONG_TERM_REF |
| 712 | pCtx->bParamSetsLostFlag = true; | 715 | pCtx->bParamSetsLostFlag = true; |
| 713 | #else | 716 | #else |
| 714 | pCtx->bReferenceLostAtT0Flag = true; | 717 | pCtx->bReferenceLostAtT0Flag = true; |
| 715 | #endif | 718 | #endif |
| 716 | return pCtx->iErrorCode; | 719 | return pCtx->iErrorCode; |
| 720 | } | ||
| 717 | } | 721 | } |
| 718 | } | 722 | } |
| 719 | if (iRet) { | 723 | if (iRet) { |