History

Merge pull request #2083 from HaiboZhu/Bugfix_OutOfMemory_post_process

Force reset decoder when out of memory error

zhilwang committed 11 years ago

Commit 5d9b9522 parents 7da20f8 27a9af04 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
@@ -259,6 +259,18 @@ int32_t CWelsDecoder::InitDecoder (const bool bParseOnly) { · 258 unmodified lines
259 return WelsInitDecoder (m_pDecContext, bParseOnly, &m_pWelsTrace->m_sLogCtx);259 return WelsInitDecoder (m_pDecContext, bParseOnly, &m_pWelsTrace->m_sLogCtx);
260}260}
261 261
262int32_t CWelsDecoder::ResetDecoder() {
263 // TBC: need to be modified when context and trace point are null
264 if (m_pDecContext != NULL && m_pWelsTrace != NULL) {
265 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "ResetDecoder(), context error code is %d",
266 m_pDecContext->iErrorCode);
267 return InitDecoder (m_pDecContext->bParseOnly);
268 } else if (m_pWelsTrace != NULL) {
269 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "ResetDecoder() failed as decoder context null");
270 }
271 return ERR_INFO_UNINIT;
272}
273
262/*274/*
263 * Set Option275 * Set Option
264 */276 */
@@ -488,7 +500,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 223 unmodified lines
488 eNalType = m_pDecContext->sCurNalHead.eNalUnitType;500 eNalType = m_pDecContext->sCurNalHead.eNalUnitType;
489 501
490 if (m_pDecContext->iErrorCode & dsOutOfMemory) {502 if (m_pDecContext->iErrorCode & dsOutOfMemory) {
491 ForceResetParaSetStatusAndAUList (m_pDecContext);503 ResetDecoder();
492 }504 }
493 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.505 //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.
494 if ((IS_PARAM_SETS_NALS (eNalType) || NAL_UNIT_CODED_SLICE_IDR == eNalType) ||506 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