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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user