Make unbounded channels explicit.

We used to have unbounded channels embedded within rtpconn
and webClient.  Make the structure explicit and testable.
This commit is contained in:
Juliusz Chroboczek
2023-12-09 16:56:33 +01:00
parent dcde4562f5
commit 00fbfafeeb
5 changed files with 128 additions and 61 deletions
+2 -5
View File
@@ -31,11 +31,8 @@ func readLoop(track *rtpUpTrack) {
for {
select {
case <-track.actionCh:
track.mu.Lock()
actions := track.actions
track.actions = nil
track.mu.Unlock()
case <-track.actions.Ch:
actions := track.actions.Get()
for _, action := range actions {
switch action.action {
case trackActionAdd, trackActionDel: