Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 4 files). Show all
Unified · Split
| @@ -258,6 +258,18 @@ int32_t CWelsDecoder::InitDecoder (const bool bParseOnly) { · 257 unmodified lines | ||
| 258 | 258 | return WelsInitDecoder (m_pDecContext, bParseOnly, &m_pWelsTrace->m_sLogCtx); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | +int32_t CWelsDecoder::ResetDecoder() { | |
| 262 | + // TBC: need to be modified when context and trace point are null | |
| 263 | + if (m_pDecContext != NULL && m_pWelsTrace != NULL) { | |
| 264 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "ResetDecoder(), context error code is %d", | |
| 265 | + m_pDecContext->iErrorCode); | |
| 266 | + return InitDecoder (m_pDecContext->bParseOnly); | |
| 267 | + } else if (m_pWelsTrace != NULL) { | |
| 268 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "ResetDecoder() failed as decoder context null"); | |
| 269 | + } | |
| 270 | + return ERR_INFO_UNINIT; | |
| 271 | +} | |
| 272 | + | |
| 261 | 273 | /* |
| 262 | 274 | * Set Option |
| 263 | 275 | */ |
| @@ -487,7 +499,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 223 unmodified lines | ||
| 487 | 499 | eNalType = m_pDecContext->sCurNalHead.eNalUnitType; |
| 488 | 500 | |
| 489 | 501 | if (m_pDecContext->iErrorCode & dsOutOfMemory) { |
| 490 | − ForceResetParaSetStatusAndAUList (m_pDecContext); | |
| 502 | + ResetDecoder(); | |
| 491 | 503 | } |
| 492 | 504 | //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss. |
| 493 | 505 | if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) || |