Skip to content

Commit 2af6bdb

Browse files
committed
Update CaptureCircularBuffer.cs
1 parent f3c0887 commit 2af6bdb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

source/TS.NET/Memory/CaptureCircularBuffer.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ public bool TryStartWrite()
135135
{
136136
if (currentCaptureCount == maxCaptureCount)
137137
{
138-
captureDrops++;
139-
intervalCaptureDrops++;
140138
FinishRead(drop: true); // Remove oldest buffer
141139
}
142140
}
@@ -203,9 +201,14 @@ private void FinishRead(bool drop = false)
203201
readCaptureOffset += (channelCount * channelCaptureLength);
204202
if (readCaptureOffset >= wraparoundOffset)
205203
readCaptureOffset = 0;
206-
captureReads++;
207-
if (!drop)
204+
if (drop)
208205
{
206+
captureDrops++;
207+
intervalCaptureDrops++;
208+
}
209+
else
210+
{
211+
captureReads++;
209212
intervalCaptureReads++;
210213
}
211214
readInProgress = false;

0 commit comments

Comments
 (0)