Commit 80cb0a2f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Simplify VP9 keyframe detection.

parent 0ec9f92d
...@@ -46,16 +46,9 @@ func isKeyframe(codec string, packet *rtp.Packet) (bool, bool) { ...@@ -46,16 +46,9 @@ func isKeyframe(codec string, packet *rtp.Packet) (bool, bool) {
profile := (vp9.Payload[0] >> 4) & 0x3 profile := (vp9.Payload[0] >> 4) & 0x3
if profile != 3 { if profile != 3 {
if (vp9.Payload[0] & 0x8) != 0 { return (vp9.Payload[0] & 0xC) == 0, true
return false, true
}
return (vp9.Payload[0] & 0x4) == 0, true
} else {
if (vp9.Payload[0] & 0x4) != 0 {
return false, true
}
return (vp9.Payload[0] & 0x2) == 0, true
} }
return (vp9.Payload[0] & 0x6) == 0, true
case "video/h264": case "video/h264":
if len(packet.Payload) < 1 { if len(packet.Payload) < 1 {
return false, false return false, false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment