diff --git a/pkg/isapi/custom.go b/pkg/isapi/custom.go index b6a2e29b1..694acac24 100644 --- a/pkg/isapi/custom.go +++ b/pkg/isapi/custom.go @@ -3,6 +3,6 @@ package isapi import "github.com/AlexxIT/go2rtc/pkg/custom" func (c *Client) startBitrateWorker() { - c.stopBitrateWorker = make(chan struct{}) + c.stopBitrateWorker = make(chan struct{}, 1) go custom.StartBitrateWorker(&c.send, &c.bitrate, c.stopBitrateWorker) } diff --git a/pkg/mp4/custom.go b/pkg/mp4/custom.go index 6b1ca355c..296a79715 100644 --- a/pkg/mp4/custom.go +++ b/pkg/mp4/custom.go @@ -3,6 +3,6 @@ package mp4 import "github.com/AlexxIT/go2rtc/pkg/custom" func (c *Consumer) startBitrateWorker() { - c.stopBitrateWorker = make(chan struct{}) + c.stopBitrateWorker = make(chan struct{}, 1) go custom.StartBitrateWorker(&c.SuperConsumer.Send, &c.SuperConsumer.Bitrate, c.stopBitrateWorker) } diff --git a/pkg/webrtc/custom.go b/pkg/webrtc/custom.go index 16c94b20c..ad54bfef4 100644 --- a/pkg/webrtc/custom.go +++ b/pkg/webrtc/custom.go @@ -5,6 +5,6 @@ import ( ) func (c *Conn) startBitrateWorker() { - c.stopBitrateWorker = make(chan struct{}) + c.stopBitrateWorker = make(chan struct{}, 1) go custom.StartBitrateWorker(&c.send, &c.bitrate, c.stopBitrateWorker) }