History

Force reset decoder when out of memory error

Haibo Zhu committed 11 years ago

Commit 27a9af01 parent ab4e0df4 files · +16 −1Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 4 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+13−1
@@ -258,6 +258,18 @@ int32_t CWelsDecoder::InitDecoder (const bool bParseOnly) { · 257 unmodified lines
258 return WelsInitDecoder (m_pDecContext, bParseOnly, &m_pWelsTrace->m_sLogCtx);258 return WelsInitDecoder (m_pDecContext, bParseOnly, &m_pWelsTrace->m_sLogCtx);
259}259}
260 260
261int32_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 * Set Option274 * Set Option
263 */275 */
@@ -487,7 +499,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 223 unmodified lines
487 eNalType = m_pDecContext->sCurNalHead.eNalUnitType;499 eNalType = m_pDecContext->sCurNalHead.eNalUnitType;
488 500
489 if (m_pDecContext->iErrorCode & dsOutOfMemory) {501 if (m_pDecContext->iErrorCode & dsOutOfMemory) {
490 ForceResetParaSetStatusAndAUList (m_pDecContext);502 ResetDecoder();
491 }503 }
492 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.504 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.
493 if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||505 if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||

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