Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 5 files). Show all
Unified · Split
| @@ -574,7 +574,10 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 573 unmodified lines | ||
| 574 | 574 | |
| 575 | 575 | m_pDecContext->iErrorCode = dsErrorFree; //initialize at the starting of AU decoding. |
| 576 | 576 | m_pDecContext->eErrorConMethod = ERROR_CON_DISABLE; //add protection to disable EC here. |
| 577 | − m_pDecContext->pParserBsInfo = pDstInfo; | |
| 577 | + if (!m_pDecContext->bFramePending) { //frame complete | |
| 578 | + m_pDecContext->pParserBsInfo->iNalNum = 0; | |
| 579 | + memset (m_pDecContext->pParserBsInfo->iNalLenInByte, 0, MAX_NAL_UNITS_IN_LAYER); | |
| 580 | + } | |
| 578 | 581 | pDstInfo->iNalNum = 0; |
| 579 | 582 | pDstInfo->iSpsWidthInPixel = pDstInfo->iSpsHeightInPixel = 0; |
| 580 | 583 | if (pDstInfo) { |
| @@ -584,6 +587,10 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 3 unmodified lines | ||
| 584 | 587 | m_pDecContext->uiTimeStamp = 0; |
| 585 | 588 | } |
| 586 | 589 | WelsDecodeBs (m_pDecContext, kpSrc, kiSrcLen, NULL, NULL, pDstInfo); |
| 590 | + if (!m_pDecContext->bFramePending && m_pDecContext->pParserBsInfo->iNalNum) { | |
| 591 | + memcpy (pDstInfo, m_pDecContext->pParserBsInfo, sizeof (SParserBsInfo)); | |
| 592 | + } | |
| 593 | + | |
| 587 | 594 | m_pDecContext->bInstantDecFlag = false; //reset no-delay flag |
| 588 | 595 | |
| 589 | 596 | return (DECODING_STATE) m_pDecContext->iErrorCode; |