History

bug fix for parseonly multi-data in

huili2 committed 11 years ago

Commit 20f28cd1 parent 050c6833 files · +6 −4Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+4−4
@@ -74,7 +74,6 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 73 unmodified lines
7474
7575 if (pCtx->bParseOnly) { //should exit for parse only to prevent access NULL pDstInfo
7676 PAccessUnit pCurAu = pCtx->pAccessUnitList;
77− static bool bFirstIDR = true;
7877 if (dsErrorFree == pCtx->iErrorCode) { //correct decoding, add to data buffer
7978 SParserBsInfo* pParser = pCtx->pParserBsInfo;
8079 SNalUnit* pCurNal = NULL;
@@ -94,7 +93,7 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 13 unmodified lines
9493 pParser->iSpsHeightInPixel = (pCtx->pSps->iMbHeight << 4);
9594
9695 if (pCurAu->pNalUnitsList [iIdx]->sNalHeaderExt.bIdrFlag) { //IDR
97− if (bFirstIDR) { //add required sps/pps
96+ if (pCtx->bFrameFinish) { //add required sps/pps
9897 bool bSubSps = (NAL_UNIT_CODED_SLICE_EXT == pCurAu->pNalUnitsList [iIdx]->sNalHeaderExt.sNalUnitHeader.eNalUnitType);
9998 SSpsBsInfo* pSpsBs = NULL;
10099 SPpsBsInfo* pPpsBs = NULL;
@@ -111,10 +110,10 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 10 unmodified lines
111110 memcpy (pDstBuf, pPpsBs->pPpsBsBuf, pPpsBs->uiPpsBsLen);
112111 pParser->iNalLenInByte [pParser->iNalNum ++] = pPpsBs->uiPpsBsLen;
113112 pDstBuf += pPpsBs->uiPpsBsLen;
114− bFirstIDR = false;
113+ pCtx->bFrameFinish = false;
115114 }
116115 } else { //IDR required SPS, PPS
117− bFirstIDR = true;
116+ pCtx->bFrameFinish = true;
118117 }
119118 //then VCL data re-write
120119 while (iIdx <= iEndIdx) {
@@ -2364,6 +2363,7 @@ bool CheckAndFinishLastPic (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferIn · 2243 unmodified lines
23642363 }
23652364 } else if (pCtx->bParseOnly) { //clear parse only internal data status
23662365 pCtx->pParserBsInfo->iNalNum = 0;
2366+ pCtx->bFrameFinish = true; //clear frame pending status here!
23672367 } else {
23682368 if (DecodeFrameConstruction (pCtx, ppDst, pDstInfo)) {
23692369 pCtx->pDec = NULL;

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