codec/h264/lex.go: fixed bug in handleFUA

This commit is contained in:
Saxon 2019-05-27 14:23:33 +09:30
parent 85a5f043c8
commit 0ee6e86638
1 changed files with 4 additions and 4 deletions

View File

@ -266,19 +266,19 @@ func (l *RTPLexer) handleFUA(d []byte) {
// If start, form new header, skip FU indicator only and set first byte to
// new header. Otherwise, skip over both FU indicator and FU header.
if start {
newHead := (d[0] & 0xe0) | (d[1] & 0x1f)
d = d[1:]
d[0] = newHead
if end {
panic("bad fragmentation packet")
}
newHead := (d[0] & 0xe0) | (d[0] & 0x1f)
d = d[1:]
d[0] = newHead
l.frag = true
l.writeWithPrefix(d)
} else {
d = d[2:]
if end {
l.frag = false
}
d = d[2:]
l.writeNoPrefix(d)
}
}