mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-09 05:32:46 +02:00
some fixes for new audio injector setup
This commit is contained in:
parent
0d769329bf
commit
00998ba75e
2 changed files with 5 additions and 3 deletions
|
@ -291,10 +291,11 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
for (AgentList::iterator agent = agentList->begin(); agent != agentList->end(); agent++) {
|
||||
if (agent->getLinkedData()) {
|
||||
|
||||
AudioRingBuffer* ringBuffer = (AudioRingBuffer*) agent->getLinkedData();
|
||||
if (memcmp(ringBuffer->getStreamIdentifier(),
|
||||
packetData + 1,
|
||||
sizeof(STREAM_IDENTIFIER_NUM_BYTES) == 0)) {
|
||||
STREAM_IDENTIFIER_NUM_BYTES) == 0) {
|
||||
// this is the matching stream, assign to matchingInjector and stop looking
|
||||
matchingInjector = &*agent;
|
||||
break;
|
||||
|
|
|
@ -69,8 +69,9 @@ void AudioInjector::injectAudio(UDPSocket* injectorSocket, sockaddr* destination
|
|||
|
||||
timeval startTime;
|
||||
|
||||
// one byte for header, 3 positional floats, 1 bearing float, 1 attenuation modifier byte
|
||||
int leadingBytes = 1 + (sizeof(float) * 4) + 1;
|
||||
// calculate the number of bytes required for additional data
|
||||
int leadingBytes = sizeof(PACKET_HEADER) + sizeof(_streamIdentifier)
|
||||
+ sizeof(_position) + sizeof(_bearing) + sizeof(_volume);
|
||||
unsigned char dataPacket[BUFFER_LENGTH_BYTES + leadingBytes];
|
||||
|
||||
dataPacket[0] = PACKET_HEADER_INJECT_AUDIO;
|
||||
|
|
Loading…
Reference in a new issue