From 682b0b73352b9fc6633bc74f33dea2d4fed39053 Mon Sep 17 00:00:00 2001 From: Haibo Zhu Date: Fri, 5 Jun 2015 01:32:47 -0700 Subject: [PATCH] Bug fix about mosaic on T30 which caused by prev frame num update --- codec/decoder/core/src/decoder_core.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index 8b01cdcc..83b3c5ba 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -2345,7 +2345,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf } // need update frame_num due current frame is well decoded - pCtx->iPrevFrameNum = pSh->iFrameNum; + if (pCurAu->pNalUnitsList[pCurAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc > 0) + pCtx->iPrevFrameNum = pSh->iFrameNum; if (pCtx->bLastHasMmco5) pCtx->iPrevFrameNum = 0; } @@ -2403,7 +2404,8 @@ bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferIn } } pCtx->pDec = NULL; - pCtx->iPrevFrameNum = pCtx->sLastSliceHeader.iFrameNum; //save frame_num + if (pAu->pNalUnitsList[pAu->uiStartPos]->sNalHeaderExt.sNalUnitHeader.uiNalRefIdc > 0) + pCtx->iPrevFrameNum = pCtx->sLastSliceHeader.iFrameNum; //save frame_num if (pCtx->bLastHasMmco5) pCtx->iPrevFrameNum = 0; }