Skip to content

Commit 7a8b658

Browse files
committed
Make AnalogIO only check for Analog buffer size when there is a frame on the digital IO
1 parent 441341c commit 7a8b658

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

Source/Devices/AnalogIO.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ void AnalogIO::addSourceBuffers(OwnedArray<DataBuffer>& sourceBuffers)
209209
void AnalogIO::processFrame(uint64_t eventWord)
210210
{
211211
oni_frame_t* frame;
212-
while (!frameQueue.try_dequeue(frame)); //NB: This while is for safety, but this method should never be called unless a frame is sure to be there
212+
if (!frameQueue.try_dequeue(frame)) { //NB: This method should never be called unless a frame is sure to be there
213+
jassertfalse;
214+
}
213215

214216
int16_t* dataPtr = (int16_t*)frame->data;
215217

Source/Devices/AuxiliaryIO.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,9 @@ bool AuxiliaryIO::isEnabled() const
5656

5757
void AuxiliaryIO::processFrames()
5858
{
59-
if (!digitalIO->isEnabled() && !analogIO->isEnabled())
60-
{
61-
return;
62-
}
63-
else if (!digitalIO->isEnabled())
64-
{
65-
analogIO->processFrames();
66-
return;
67-
}
68-
else if (!analogIO->isEnabled())
69-
{
70-
digitalIO->processFrames();
71-
while (digitalIO->hasEventWord())
72-
{
73-
digitalIO->getEventWord();
74-
}
75-
76-
return;
77-
}
78-
7959
digitalIO->processFrames();
8060

81-
while (analogIO->getNumberOfFrames() >= AnalogIO::framesToAverage && digitalIO->getNumberOfWords() >= 1)
61+
while (digitalIO->hasEventWord() && analogIO->getNumberOfFrames() >= AnalogIO::framesToAverage)
8262
{
8363
auto eventWord = digitalIO->getEventWord();
8464

0 commit comments

Comments
 (0)