shithub: openh264

Download patch

ref: 3567a2e316b81b32cd8036110ff16a149512986f
parent: 7746e3f497720705365823c9d5af90802c8dd647
parent: 1839910bb0ea4bb9fb32944b4e3f2452dcf57b58
author: HaiboZhu <haibozhu@cisco.com>
date: Thu May 8 08:43:58 EDT 2014

Merge pull request #796 from huili2/new_seq_au_reorder

fix order of new AU and new Seq

--- a/codec/decoder/core/src/au_parser.cpp
+++ b/codec/decoder/core/src/au_parser.cpp
@@ -405,7 +405,12 @@
   const PNalUnitHeaderExt kpCurNalHeaderExt = &kpCurNal->sNalHeaderExt;
   const SSliceHeader* kpLastSliceHeader = &kpLastNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
   const SSliceHeader* kpCurSliceHeader = &kpCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
-
+  if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL
+      && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {
+    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;
@@ -412,11 +417,6 @@
   }
   if (kpLastSliceHeader->iFrameNum != kpCurSliceHeader->iFrameNum)
     return true;
-  if (pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != NULL
-      && pCtx->pActiveLayerSps[kpCurNalHeaderExt->uiDependencyId] != kpSps) {
-    pCtx->bNextNewSeqBegin = true;
-    return true; // the active sps changed, new sequence begins, so the current au is ready
-  }
   // Subclause 7.4.1.2.5
   if (kpLastSliceHeader->iRedundantPicCnt > kpCurSliceHeader->iRedundantPicCnt)
     return true;