shithub: openh264

Download patch

ref: eb1276013b8c83e38e1da8d044e45dc03275db44
parent: 7ef2e9553ce4c8985a36fbf8d5927ce9e83fa2de
author: huili2 <huili2@cisco.com>
date: Mon May 12 18:02:39 EDT 2014

clear active PS when only IDR meets

--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -322,6 +322,10 @@
       return NULL;
     }
 
+    if ((uiAvailNalNum == 1) && ((NAL_UNIT_CODED_SLICE_IDR == pNalUnitHeader->eNalUnitType)
+                                 || (pCurNal->sNalHeaderExt.bIdrFlag))) {
+      ResetActiveSPSForEachLayer (pCtx);
+    }
     if ((uiAvailNalNum > 1) &&
         CheckAccessUnitBoundary (pCtx, pCurAu->pNalUnitsList[uiAvailNalNum - 1], pCurAu->pNalUnitsList[uiAvailNalNum - 2],
                                  pCurAu->pNalUnitsList[uiAvailNalNum - 1]->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps)) {
@@ -410,7 +414,7 @@
     pCtx->bNextNewSeqBegin = true;
     return true; // the active sps changed, new sequence begins, so the current au is ready
   }
- 
+
   //Sub-clause 7.1.4.1.1 temporal_id
   if (kpLastNalHeaderExt->uiTemporalId != kpCurNalHeaderExt->uiTemporalId) {
     return true;