Skip to content

Commit cf4a550

Browse files
authored
Use sequence parameter sets for h.264 keyframe detection (#551)
Similar to the change made in Galene by jech, use SPS to detect keyframes jech/galene@4435a30
1 parent a229414 commit cf4a550

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/buffer/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func isH264Keyframe(payload []byte) bool {
163163
return false
164164
}
165165
n := payload[i+offset] & 0x1F
166-
if n == 5 {
166+
if n == 7 {
167167
return true
168168
} else if n >= 24 {
169169
// is this legal?
@@ -184,7 +184,7 @@ func isH264Keyframe(payload []byte) bool {
184184
// not a starting fragment
185185
return false
186186
}
187-
return payload[1]&0x1F == 5
187+
return payload[1]&0x1F == 7
188188
}
189189
return false
190190
}

0 commit comments

Comments
 (0)