shithub: openh264

Download patch

ref: 3ccecfbdbea6ba0aaa01db697d809e72b6203937
parent: c9433ee73bcc4a0e42fec17a34692833e75a26cf
author: Haibo Zhu <[email protected]>
date: Wed Apr 20 05:58:12 EDT 2016

Add the log reduce logic into parse only mode

--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -330,7 +330,8 @@
     if (m_pWelsTrace) {
       WelsTraceCallback callback = * ((WelsTraceCallback*)pOption);
       m_pWelsTrace->SetTraceCallback (callback);
-      WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::SetOption():DECODER_OPTION_TRACE_CALLBACK callback = %p.",
+      WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
+               "CWelsDecoder::SetOption():DECODER_OPTION_TRACE_CALLBACK callback = %p.",
                callback);
     }
     return cmResultSuccess;
@@ -510,7 +511,7 @@
     eNalType = m_pDecContext->sCurNalHead.eNalUnitType;
 
     if (m_pDecContext->iErrorCode & dsOutOfMemory) {
-      if(ResetDecoder())
+      if (ResetDecoder())
         return dsOutOfMemory;
     }
     //for AVC bitstream (excluding AVC with temporal scalability, including TP), as long as error occur, SHOULD notify upper layer key frame loss.
@@ -647,6 +648,11 @@
   }
 
   m_pDecContext->bInstantDecFlag = false; //reset no-delay flag
+
+  if (m_pDecContext->iErrorCode && m_pDecContext->bPrintFrameErrorTraceFlag) {
+    WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "decode failed, failure type:%d \n", m_pDecContext->iErrorCode);
+    m_pDecContext->bPrintFrameErrorTraceFlag = false;
+  }
 
   return (DECODING_STATE) m_pDecContext->iErrorCode;
 }