summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Tomlinson <themarcustomlinson@gmail.com>2019-02-24 16:15:29 +0000
committerStephen Sinclair <radarsat1@users.noreply.github.com>2019-02-25 12:03:01 +0100
commit939bc9655bde74ef37ebf77bbfb95802439d69db (patch)
treef4a788034a3534dd36c062976f7eb26e7827328e
parent155ccfd9ebbfe3180797266c80a8c83d1dfee42a (diff)
WASAPI : Ring buffer in/out index fix
-rw-r--r--RtAudio.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index ce2001d..f38c60f 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -3841,8 +3841,9 @@ public:
relOutIndex += bufferSize_;
}
- // "in" index can end on the "out" index but cannot begin at it
- if ( inIndex_ < relOutIndex && inIndexEnd > relOutIndex ) {
+ // the "IN" index CAN BEGIN at the "OUT" index
+ // the "IN" index CANNOT END at the "OUT" index
+ if ( inIndex_ < relOutIndex && inIndexEnd >= relOutIndex ) {
return false; // not enough space between "in" index and "out" index
}
@@ -3902,7 +3903,8 @@ public:
relInIndex += bufferSize_;
}
- // "out" index can begin at and end on the "in" index
+ // the "OUT" index CANNOT BEGIN at the "IN" index
+ // the "OUT" index CAN END at the "IN" index
if ( outIndex_ <= relInIndex && outIndexEnd > relInIndex ) {
return false; // not enough space between "out" index and "in" index
}