mirror of
				https://github.com/aler9/gortsplib
				synced 2025-10-31 10:36:26 +08:00 
			
		
		
		
	client: remove channel from ReadFrames()
This commit is contained in:
		| @@ -23,9 +23,13 @@ func main() { | ||||
|  | ||||
| 	for { | ||||
| 		// read RTP frames | ||||
| 		done := conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) { | ||||
| 			fmt.Printf("frame from track %d, type %v, size %d\n", trackID, typ, len(buf)) | ||||
| 		}) | ||||
| 		done := make(chan struct{}) | ||||
| 		go func() { | ||||
| 			defer close(done) | ||||
| 			conn.ReadFrames(func(trackID int, typ gortsplib.StreamType, buf []byte) { | ||||
| 				fmt.Printf("frame from track %d, type %v, size %d\n", trackID, typ, len(buf)) | ||||
| 			}) | ||||
| 		}() | ||||
|  | ||||
| 		// wait | ||||
| 		time.Sleep(5 * time.Second) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 aler9
					aler9