mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +02:00
more windows build fixes
This commit is contained in:
parent
bd67531ffd
commit
cb828d330a
2 changed files with 15 additions and 8 deletions
|
@ -14,6 +14,12 @@
|
||||||
|
|
||||||
#include "PositionalAudioRingBuffer.h"
|
#include "PositionalAudioRingBuffer.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
bool isnan_(double value) { return _isnan(value); }
|
||||||
|
#else
|
||||||
|
bool isnan_(double value) { return std::isnan(value); }
|
||||||
|
#endif
|
||||||
|
|
||||||
PositionalAudioRingBuffer::PositionalAudioRingBuffer(PositionalAudioRingBuffer::Type type) :
|
PositionalAudioRingBuffer::PositionalAudioRingBuffer(PositionalAudioRingBuffer::Type type) :
|
||||||
AudioRingBuffer(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL),
|
AudioRingBuffer(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL),
|
||||||
_type(type),
|
_type(type),
|
||||||
|
@ -22,7 +28,7 @@ PositionalAudioRingBuffer::PositionalAudioRingBuffer(PositionalAudioRingBuffer::
|
||||||
_willBeAddedToMix(false),
|
_willBeAddedToMix(false),
|
||||||
_shouldLoopbackForNode(false)
|
_shouldLoopbackForNode(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PositionalAudioRingBuffer::~PositionalAudioRingBuffer() {
|
PositionalAudioRingBuffer::~PositionalAudioRingBuffer() {
|
||||||
|
@ -33,25 +39,25 @@ int PositionalAudioRingBuffer::parseData(unsigned char* sourceBuffer, int numByt
|
||||||
currentBuffer += NUM_BYTES_RFC4122_UUID; // the source UUID
|
currentBuffer += NUM_BYTES_RFC4122_UUID; // the source UUID
|
||||||
currentBuffer += parsePositionalData(currentBuffer, numBytes - (currentBuffer - sourceBuffer));
|
currentBuffer += parsePositionalData(currentBuffer, numBytes - (currentBuffer - sourceBuffer));
|
||||||
currentBuffer += writeData((char*) currentBuffer, numBytes - (currentBuffer - sourceBuffer));
|
currentBuffer += writeData((char*) currentBuffer, numBytes - (currentBuffer - sourceBuffer));
|
||||||
|
|
||||||
return currentBuffer - sourceBuffer;
|
return currentBuffer - sourceBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PositionalAudioRingBuffer::parsePositionalData(unsigned char* sourceBuffer, int numBytes) {
|
int PositionalAudioRingBuffer::parsePositionalData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
unsigned char* currentBuffer = sourceBuffer;
|
unsigned char* currentBuffer = sourceBuffer;
|
||||||
|
|
||||||
memcpy(&_position, currentBuffer, sizeof(_position));
|
memcpy(&_position, currentBuffer, sizeof(_position));
|
||||||
currentBuffer += sizeof(_position);
|
currentBuffer += sizeof(_position);
|
||||||
|
|
||||||
memcpy(&_orientation, currentBuffer, sizeof(_orientation));
|
memcpy(&_orientation, currentBuffer, sizeof(_orientation));
|
||||||
currentBuffer += sizeof(_orientation);
|
currentBuffer += sizeof(_orientation);
|
||||||
|
|
||||||
// if this node sent us a NaN for first float in orientation then don't consider this good audio and bail
|
// if this node sent us a NaN for first float in orientation then don't consider this good audio and bail
|
||||||
if (std::isnan(_orientation.x)) {
|
if (std::isnan(_orientation.x)) {
|
||||||
reset();
|
reset();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentBuffer - sourceBuffer;
|
return currentBuffer - sourceBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +72,12 @@ bool PositionalAudioRingBuffer::shouldBeAddedToMix(int numJitterBufferSamples) {
|
||||||
} else {
|
} else {
|
||||||
// good buffer, add this to the mix
|
// good buffer, add this to the mix
|
||||||
_isStarved = false;
|
_isStarved = false;
|
||||||
|
|
||||||
// since we've read data from ring buffer at least once - we've started
|
// since we've read data from ring buffer at least once - we've started
|
||||||
_hasStarted = true;
|
_hasStarted = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QUuid>
|
#include <QtCore/QUuid>
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
#include <Logging.h>
|
#include <Logging.h>
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue