mirror of https://bitbucket.org/ausocean/av.git
codec/lex/lex_test.go: rtpRead.Read() checks for incomplete reads of packets buffer and resizes accordingly
This commit is contained in:
parent
c31c76e1f5
commit
1fb4381b8e
|
@ -45,7 +45,11 @@ func (r *rtpReader) Read(p []byte) (int, error) {
|
|||
}
|
||||
b := r.packets[r.idx]
|
||||
n := copy(p, b)
|
||||
if n < len(r.packets[r.idx]) {
|
||||
r.packets[r.idx] = r.packets[r.idx][n:]
|
||||
} else {
|
||||
r.idx++
|
||||
}
|
||||
return n, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue