We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6074196 commit 1a044d5Copy full SHA for 1a044d5
pcm.go
@@ -205,8 +205,8 @@ func (w *sampleWriter[T]) WriteSample(in T) error {
205
if !w.lastWrite.IsZero() {
206
timeSinceLastWrite := time.Since(w.lastWrite)
207
tolerance := w.sampleDur / 10
208
- if timeSinceLastWrite > w.sampleDur+tolerance {
209
- droppedPackets = uint16((timeSinceLastWrite - w.sampleDur) / w.sampleDur)
+ if timeSinceLastWrite > (w.sampleDur + tolerance) {
+ droppedPackets = uint16((timeSinceLastWrite - (w.sampleDur - tolerance)) / w.sampleDur)
210
}
211
212
0 commit comments