mirror of
https://github.com/nonoo/kappanhang.git
synced 2026-01-07 01:09:57 +01:00
Fine tune buffer lengths
This commit is contained in:
parent
029dd27e3f
commit
1a30f43cb0
|
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
const audioTimeoutDuration = 3 * time.Second
|
||||
const audioRxSeqBufLength = 120 * time.Millisecond
|
||||
const audioRxSeqBufLength = 300 * time.Millisecond
|
||||
|
||||
type audioStream struct {
|
||||
common streamCommon
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package main
|
|||
|
||||
import "time"
|
||||
|
||||
const txSeqBufLength = 500 * time.Millisecond
|
||||
const txSeqBufLength = 300 * time.Millisecond
|
||||
|
||||
type txSeqBufStruct struct {
|
||||
entries []seqBufEntry
|
||||
|
|
@ -18,7 +18,7 @@ func (s *txSeqBufStruct) add(seq seqNum, p []byte) {
|
|||
}
|
||||
|
||||
func (s *txSeqBufStruct) purgeOldEntries() {
|
||||
for len(s.entries) > 0 && time.Since(s.entries[0].addedAt) > txSeqBufLength {
|
||||
for len(s.entries) > 0 && time.Since(s.entries[0].addedAt) > txSeqBufLength*2 {
|
||||
s.entries = s.entries[1:]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue