mirror of
				https://github.com/aler9/gortsplib
				synced 2025-10-31 18:42:40 +08:00 
			
		
		
		
	revert 15ec133
				
					
				
			This commit is contained in:
		| @@ -7,7 +7,7 @@ import ( | |||||||
| ) | ) | ||||||
|  |  | ||||||
| // find IDR NALUs without decoding RTP | // find IDR NALUs without decoding RTP | ||||||
| func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { | func rtpH264ContainsIDR(pkt *rtp.Packet) bool { | ||||||
| 	if len(pkt.Payload) == 0 { | 	if len(pkt.Payload) == 0 { | ||||||
| 		return false | 		return false | ||||||
| 	} | 	} | ||||||
| @@ -15,7 +15,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { | |||||||
| 	typ := h264.NALUType(pkt.Payload[0] & 0x1F) | 	typ := h264.NALUType(pkt.Payload[0] & 0x1F) | ||||||
|  |  | ||||||
| 	switch typ { | 	switch typ { | ||||||
| 	case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: | 	case h264.NALUTypeIDR: | ||||||
| 		return true | 		return true | ||||||
|  |  | ||||||
| 	case 24: // STAP-A | 	case 24: // STAP-A | ||||||
| @@ -37,8 +37,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { | |||||||
| 			payload = payload[size:] | 			payload = payload[size:] | ||||||
|  |  | ||||||
| 			typ = h264.NALUType(nalu[0] & 0x1F) | 			typ = h264.NALUType(nalu[0] & 0x1F) | ||||||
| 			switch typ { | 			if typ == h264.NALUTypeIDR { | ||||||
| 			case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: |  | ||||||
| 				return true | 				return true | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| @@ -56,11 +55,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { | |||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		typ := h264.NALUType(pkt.Payload[1] & 0x1F) | 		typ := h264.NALUType(pkt.Payload[1] & 0x1F) | ||||||
| 		switch typ { | 		return (typ == h264.NALUTypeIDR) | ||||||
| 		case h264.NALUTypeIDR, h264.NALUTypeSPS, h264.NALUTypePPS: |  | ||||||
| 			return true |  | ||||||
| 		} |  | ||||||
| 		return false |  | ||||||
|  |  | ||||||
| 	default: | 	default: | ||||||
| 		return false | 		return false | ||||||
| @@ -69,7 +64,7 @@ func rtpH264ContainsIDRorSPSorPPS(pkt *rtp.Packet) bool { | |||||||
|  |  | ||||||
| func ptsEqualsDTS(track Track, pkt *rtp.Packet) bool { | func ptsEqualsDTS(track Track, pkt *rtp.Packet) bool { | ||||||
| 	if _, ok := track.(*TrackH264); ok { | 	if _, ok := track.(*TrackH264); ok { | ||||||
| 		return rtpH264ContainsIDRorSPSorPPS(pkt) | 		return rtpH264ContainsIDR(pkt) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return true | 	return true | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 aler9
					aler9