Explorar o código

Merge pull request #752 from web2098/LeadingZeroFix

Support for nal start codes preceded by a zero
Paul-Louis Ageneau %!s(int64=2) %!d(string=hai) anos
pai
achega
1275e13e6d
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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;