Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -832,18 +832,30 @@ bool CheckSpsActive (PWelsDecoderContext pCtx, PSps pSps, bool bUseSubsetFlag) { · 831 unmodified lines | ||
| 832 | 832 | if (bUseSubsetFlag) { |
| 833 | 833 | if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSubspsAvailFlags[pSps->iSpsId] |
| 834 | 834 | && pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { |
| 835 | − PSps pNextUsedSps = | |
| 836 | − pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps; | |
| 837 | − if (pNextUsedSps->iSpsId == pSps->iSpsId) | |
| 838 | − return true; | |
| 835 | + int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum; | |
| 836 | + while (i < iNum) { | |
| 837 | + PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i]; | |
| 838 | + if (pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //ext data | |
| 839 | + PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps; | |
| 840 | + if (pNextUsedSps->iSpsId == pSps->iSpsId) | |
| 841 | + return true; | |
| 842 | + } | |
| 843 | + ++i; | |
| 844 | + } | |
| 839 | 845 | } |
| 840 | 846 | } else { |
| 841 | 847 | if (pSps->iMbWidth > 0 && pSps->iMbHeight > 0 && pCtx->bSpsAvailFlags[pSps->iSpsId] |
| 842 | 848 | && pCtx->pAccessUnitList->uiAvailUnitsNum > 0) { |
| 843 | − PSps pNextUsedSps = | |
| 844 | − pCtx->pAccessUnitList->pNalUnitsList[pCtx->pAccessUnitList->uiStartPos]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps; | |
| 845 | − if (pNextUsedSps->iSpsId == pSps->iSpsId) | |
| 846 | − return true; | |
| 849 | + int i = 0, iNum = (int32_t) pCtx->pAccessUnitList->uiAvailUnitsNum; | |
| 850 | + while (i < iNum) { | |
| 851 | + PNalUnit pNalUnit = pCtx->pAccessUnitList->pNalUnitsList[i]; | |
| 852 | + if (!pNalUnit->sNalData.sVclNal.bSliceHeaderExtFlag) { //non-ext data | |
| 853 | + PSps pNextUsedSps = pNalUnit->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps; | |
| 854 | + if (pNextUsedSps->iSpsId == pSps->iSpsId) | |
| 855 | + return true; | |
| 856 | + } | |
| 857 | + ++i; | |
| 858 | + } | |
| 847 | 859 | } |
| 848 | 860 | } |
| 849 | 861 | return false; |