Browse Source

Merge pull request #752 from web2098/LeadingZeroFix

Support for nal start codes preceded by a zero
Paul-Louis Ageneau 2 years ago
parent
commit
1275e13e6d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/h264rtppacketizer.cpp

+ 5 - 1
src/h264rtppacketizer.cpp

@@ -63,12 +63,16 @@ NalUnitStartSequenceMatch StartSequenceMatchSucc(NalUnitStartSequenceMatch match
 	case NUSM_secondZero:
 		if (byte == 0x00 && detectLong) {
 			return NUSM_thirdZero;
+		} else if (byte == 0x00 && detectShort) {
+			return NUSM_secondZero;
 		} else if (byte == 0x01 && detectShort) {
 			return NUSM_shortMatch;
 		}
 		break;
 	case NUSM_thirdZero:
-		if (byte == 0x01 && detectLong) {
+		if (byte == 0x00 && detectLong) {
+			return NUSM_thirdZero;
+		} else if (byte == 0x01 && detectLong) {
 			return NUSM_longMatch;
 		}
 		break;