mirror of
https://github.com/aler9/gortsplib
synced 2025-10-06 07:37:07 +08:00
change OnFrame signature
This commit is contained in:
@@ -23,18 +23,10 @@ func main() {
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
readerDone := make(chan struct{})
|
||||
|
||||
// read frames from the server
|
||||
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
|
||||
if err != nil {
|
||||
fmt.Printf("ERR: %v\n", err)
|
||||
close(readerDone)
|
||||
return
|
||||
}
|
||||
|
||||
done := conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte) {
|
||||
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
|
||||
})
|
||||
|
||||
<-readerDone
|
||||
<-done
|
||||
}
|
||||
|
Reference in New Issue
Block a user