codec/h265: got rid of _d in handleFragmentation

This commit is contained in:
Saxon 2019-05-09 12:07:46 +09:30
parent 6435b3c55f
commit e44d936315
1 changed files with 7 additions and 7 deletions

View File

@ -147,24 +147,24 @@ func (l *Lexer) handleAggregation(d []byte) {
// handleFragmentation parses NAL units from fragmentation packets and writes
// them to the Lexer's buf.
func (l *Lexer) handleFragmentation(d []byte) {
_d := d[3:]
if l.donl {
_d = d[5:]
}
// Get start and end indiciators from FU header.
start := d[2]&0x80 != 0
end := d[2]&0x40 != 0
d = d[3:]
if l.donl {
d = d[2:]
}
switch {
case start && !end:
l.frag = true
l.writeWithPrefix(_d)
l.writeWithPrefix(d)
case !start && end:
l.frag = false
fallthrough
case !start && !end:
l.writeNoPrefix(_d)
l.writeNoPrefix(d)
default:
panic("bad fragmentation packet")
}