Update go2rtc candidates processing

This commit is contained in:
Alexey Khit
2023-03-04 06:25:30 +03:00
parent d805d560b9
commit 9ab9412c95
7 changed files with 49 additions and 28 deletions
+18
View File
@@ -51,3 +51,21 @@ func (w *Waiter) Done() {
w.mu.Unlock()
}
func (w *Waiter) WaitChan() <-chan struct{} {
var ch chan struct{}
w.mu.Lock()
if w.state >= 0 {
ch = make(chan struct{})
go func() {
w.Wait()
ch <- struct{}{}
}()
}
w.mu.Unlock()
return ch
}