mirror of https://bitbucket.org/ausocean/av.git
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:
parent
0e7504374e
commit
35069bd4f3
|
@ -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:
|
||||
} else {
|
||||
if end {
|
||||
l.frag = false
|
||||
fallthrough
|
||||
case !start && !end:
|
||||
}
|
||||
l.writeNoPrefix(d)
|
||||
default:
|
||||
panic("bad fragmentation packet")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue