From eb1276013b8c83e38e1da8d044e45dc03275db44 Mon Sep 17 00:00:00 2001 From: huili2 Date: Mon, 12 May 2014 22:02:39 -0700 Subject: [PATCH] clear active PS when only IDR meets --- codec/decoder/core/src/au_parser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codec/decoder/core/src/au_parser.cpp b/codec/decoder/core/src/au_parser.cpp index 3f96cf74..d07d0150 100644 --- a/codec/decoder/core/src/au_parser.cpp +++ b/codec/decoder/core/src/au_parser.cpp @@ -322,6 +322,10 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade return NULL; } + if ((uiAvailNalNum == 1) && ((NAL_UNIT_CODED_SLICE_IDR == pNalUnitHeader->eNalUnitType) + || (pCurNal->sNalHeaderExt.bIdrFlag))) { + ResetActiveSPSForEachLayer (pCtx); + } if ((uiAvailNalNum > 1) && CheckAccessUnitBoundary (pCtx, pCurAu->pNalUnitsList[uiAvailNalNum - 1], pCurAu->pNalUnitsList[uiAvailNalNum - 2], pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps)) { @@ -410,7 +414,7 @@ bool CheckAccessUnitBoundary (PWelsDecoderContext pCtx, const PNalUnit kpCurNal, pCtx->bNextNewSeqBegin = true; return true; // the active sps changed, new sequence begins, so the current au is ready } - + //Sub-clause 7.1.4.1.1 temporal_id if (kpLastNalHeaderExt->uiTemporalId != kpCurNalHeaderExt->uiTemporalId) { return true;