diff --git a/internal/transport/vp8channel/transport.go b/internal/transport/vp8channel/transport.go index 5d352db..8ddf3e2 100644 --- a/internal/transport/vp8channel/transport.go +++ b/internal/transport/vp8channel/transport.go @@ -52,7 +52,6 @@ const ( outboundQueueSize = 1024 inboundQueueSize = 1024 canSendHighWatermark = 90 // percent - maxWireFPS = 120 keepaliveIdlePeriod = 100 * time.Millisecond ) @@ -357,15 +356,10 @@ func (p *streamTransport) writerLoop() { } func (p *streamTransport) sampleInterval() time.Duration { - sampleInterval := p.frameInterval if p.batchSize > 1 { - sampleInterval = p.frameInterval / time.Duration(p.batchSize) + return p.frameInterval / time.Duration(p.batchSize) } - minInterval := time.Second / maxWireFPS - if sampleInterval < minInterval { - return minInterval - } - return sampleInterval + return p.frameInterval } func (p *streamTransport) resetKCP() { diff --git a/internal/transport/vp8channel/transport_unit_test.go b/internal/transport/vp8channel/transport_unit_test.go index 15fc286..06831e7 100644 --- a/internal/transport/vp8channel/transport_unit_test.go +++ b/internal/transport/vp8channel/transport_unit_test.go @@ -20,13 +20,14 @@ type fakeVideoSession struct { err error } -func TestSampleIntervalIsCappedForLargeBatch(t *testing.T) { +func TestSampleIntervalWithBatch(t *testing.T) { tr := &streamTransport{ frameInterval: time.Second / 60, batchSize: 64, } - if got := tr.sampleInterval(); got != time.Second/maxWireFPS { - t.Fatalf("sampleInterval() = %v, want %v", got, time.Second/maxWireFPS) + want := time.Second / 60 / 64 + if got := tr.sampleInterval(); got != want { + t.Fatalf("sampleInterval() = %v, want %v", got, want) } tr.batchSize = 1