mirror of
https://github.com/jech/galene.git
synced 2024-12-26 01:05:48 +01:00
Simplify VP9 keyframe detection.
This commit is contained in:
parent
0ec9f92dad
commit
80cb0a2f30
1 changed files with 2 additions and 9 deletions
|
@ -46,16 +46,9 @@ func isKeyframe(codec string, packet *rtp.Packet) (bool, bool) {
|
|||
|
||||
profile := (vp9.Payload[0] >> 4) & 0x3
|
||||
if profile != 3 {
|
||||
if (vp9.Payload[0] & 0x8) != 0 {
|
||||
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] & 0xC) == 0, true
|
||||
}
|
||||
return (vp9.Payload[0] & 0x6) == 0, true
|
||||
case "video/h264":
|
||||
if len(packet.Payload) < 1 {
|
||||
return false, false
|
||||
|
|
Loading…
Reference in a new issue