fix examples

This commit is contained in:
aler9
2020-07-13 09:42:16 +02:00
parent 025fa58edd
commit 643dce1dd7
2 changed files with 24 additions and 3 deletions

View File

@@ -47,11 +47,13 @@ func main() {
panic(err)
}
frame := &gortsplib.InterleavedFrame{Content: make([]byte, 512*1024)}
frame := &gortsplib.InterleavedFrame{Content: make([]byte, 0, 512*1024)}
for {
frame.Content = frame.Content[:cap(frame.Content)]
err := rconn.ReadFrame(frame)
if err != nil {
panic(err)
fmt.Println("connection is closed")
break
}
fmt.Printf("packet from track %d, type %v: %v\n",