Parcourir la source

Merge pull request #752 from web2098/LeadingZeroFix

Support for nal start codes preceded by a zero
Paul-Louis Ageneau il y a 2 ans
Parent
commit
1275e13e6d
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  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;