Fix multiple dial on add consumer

This commit is contained in:
Alex X
2024-05-03 14:30:05 +03:00
parent b3c5ef8c86
commit 2ea66deb08
3 changed files with 38 additions and 26 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package streams
import (
"encoding/json"
"sync"
"sync/atomic"
"github.com/AlexxIT/go2rtc/pkg/core"
)
@@ -11,7 +12,7 @@ type Stream struct {
producers []*Producer
consumers []core.Consumer
mu sync.Mutex
requests int32
pending atomic.Int32
}
func NewStream(source any) *Stream {