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:] d = d[2:]
} }
switch { if start {
case start && !end: if end {
panic("bad fragmentation packet")
}
l.frag = true l.frag = true
l.writeWithPrefix(d) l.writeWithPrefix(d)
case !start && end: } else {
l.frag = false if end {
fallthrough l.frag = false
case !start && !end: }
l.writeNoPrefix(d) l.writeNoPrefix(d)
default:
panic("bad fragmentation packet")
} }
} }