mirror of https://bitbucket.org/ausocean/av.git
codec/h264/lex.go: fixed bug in handleFUA
This commit is contained in:
parent
85a5f043c8
commit
0ee6e86638
|
@ -266,19 +266,19 @@ func (l *RTPLexer) handleFUA(d []byte) {
|
||||||
// If start, form new header, skip FU indicator only and set first byte to
|
// 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.
|
// new header. Otherwise, skip over both FU indicator and FU header.
|
||||||
if start {
|
if start {
|
||||||
|
newHead := (d[0] & 0xe0) | (d[1] & 0x1f)
|
||||||
|
d = d[1:]
|
||||||
|
d[0] = newHead
|
||||||
if end {
|
if end {
|
||||||
panic("bad fragmentation packet")
|
panic("bad fragmentation packet")
|
||||||
}
|
}
|
||||||
newHead := (d[0] & 0xe0) | (d[0] & 0x1f)
|
|
||||||
d = d[1:]
|
|
||||||
d[0] = newHead
|
|
||||||
l.frag = true
|
l.frag = true
|
||||||
l.writeWithPrefix(d)
|
l.writeWithPrefix(d)
|
||||||
} else {
|
} else {
|
||||||
|
d = d[2:]
|
||||||
if end {
|
if end {
|
||||||
l.frag = false
|
l.frag = false
|
||||||
}
|
}
|
||||||
d = d[2:]
|
|
||||||
l.writeNoPrefix(d)
|
l.writeNoPrefix(d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue