shithub: openh264

Download patch

ref: c4fc6642cf4d6c7cad6f9e50f92583631ebe38b1
parent: 2791929e03294a4e6b23d2f102e2c073f21182cb
author: huili2 <[email protected]>
date: Mon Jul 14 14:47:40 EDT 2014

reuse dsNoParamSets in dec

--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -508,6 +508,8 @@
     if (ERR_NONE != iErr) {	// modified for pSps/pSubsetSps invalid, 12/1/2009
       if (pCtx->iErrorConMethod == ERROR_CON_DISABLE)
         pCtx->iErrorCode |= dsNoParamSets;
+      else
+        pCtx->iErrorCode |= dsBitstreamError;
       return iErr;
     }
 
@@ -520,6 +522,8 @@
     if (ERR_NONE != iErr) {	// modified for pps invalid, 12/1/2009
       if (pCtx->iErrorConMethod == ERROR_CON_DISABLE)
         pCtx->iErrorCode |= dsNoParamSets;
+      else
+        pCtx->iErrorCode |= dsBitstreamError;
       return iErr;
     }
 
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -474,7 +474,8 @@
 #else
               pCtx->bReferenceLostAtT0Flag = true;
 #endif
-              ResetParameterSetsState (pCtx);
+              if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
+                ResetParameterSetsState (pCtx);
 
               if (dsOutOfMemory & pCtx->iErrorCode) {
                 return pCtx->iErrorCode;
@@ -489,7 +490,8 @@
 #else
               pCtx->bReferenceLostAtT0Flag = true;
 #endif
-              ResetParameterSetsState (pCtx);
+              if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode)) 
+                ResetParameterSetsState (pCtx);
             }
             return pCtx->iErrorCode;
           }
@@ -532,7 +534,8 @@
 #else
         pCtx->bReferenceLostAtT0Flag = true;
 #endif
-        ResetParameterSetsState (pCtx);
+        if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
+          ResetParameterSetsState (pCtx);
         return pCtx->iErrorCode;
       }
     }
@@ -567,7 +570,8 @@
 #else
         pCtx->bReferenceLostAtT0Flag = true;
 #endif
-        ResetParameterSetsState (pCtx);
+        if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
+          ResetParameterSetsState (pCtx);
         return pCtx->iErrorCode;
       }
     }