@@ -96,9 +96,7 @@ func (d *DownTrackSpreader) Broadcast(writer func(TrackSender)) {
|
||||
// 100µs is enough to amortize the overhead and provide sufficient load balancing.
|
||||
// WriteRTP takes about 50µs on average, so we write to 2 down tracks per loop.
|
||||
step := uint64(2)
|
||||
utils.ParallelExec(downTracks, threshold, step, func(dt TrackSender) {
|
||||
writer(dt)
|
||||
})
|
||||
utils.ParallelExec(downTracks, threshold, step, writer)
|
||||
}
|
||||
|
||||
func (d *DownTrackSpreader) DownTrackCount() int {
|
||||
|
||||
@@ -32,8 +32,8 @@ type OpsQueueParams struct {
|
||||
|
||||
type UntypedQueueOp func()
|
||||
|
||||
func (it UntypedQueueOp) run() {
|
||||
it()
|
||||
func (op UntypedQueueOp) run() {
|
||||
op()
|
||||
}
|
||||
|
||||
type OpsQueue struct {
|
||||
@@ -49,8 +49,8 @@ type typedQueueOp[T any] struct {
|
||||
arg T
|
||||
}
|
||||
|
||||
func (it typedQueueOp[T]) run() {
|
||||
it.fn(it.arg)
|
||||
func (op typedQueueOp[T]) run() {
|
||||
op.fn(op.arg)
|
||||
}
|
||||
|
||||
type TypedOpsQueue[T any] struct {
|
||||
|
||||
Reference in New Issue
Block a user