codec/h264/lex.go: using if and else statements rather than switch for start and end indicator logic in handleFUA

This commit is contained in:
Saxon 2019-05-23 13:55:25 +09:30
parent 0e7504374e
commit 35069bd4f3
1 changed files with 8 additions and 8 deletions

View File

@ -274,17 +274,17 @@ func (l *RTPLexer) handleFUA(d []byte) {
d = d[2:]
}
switch {
case start && !end:
if start {
if end {
panic("bad fragmentation packet")
}
l.frag = true
l.writeWithPrefix(d)
case !start && end:
l.frag = false
fallthrough
case !start && !end:
} else {
if end {
l.frag = false
}
l.writeNoPrefix(d)
default:
panic("bad fragmentation packet")
}
}