From cfe4783fffb6bf5d014356026fa0b68d23a5e25c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 17 May 2013 15:19:15 -0700 Subject: [PATCH] correct the memcmp for audio stream identifier --- audio-mixer/src/main.cpp | 4 +++- eve/src/main.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/audio-mixer/src/main.cpp b/audio-mixer/src/main.cpp index e2028911ef..eddff06541 100644 --- a/audio-mixer/src/main.cpp +++ b/audio-mixer/src/main.cpp @@ -292,7 +292,9 @@ 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))) { + if (memcmp(ringBuffer->getStreamIdentifier(), + packetData + 1, + sizeof(STREAM_IDENTIFIER_NUM_BYTES) == 0)) { // this is the matching stream, assign to matchingInjector and stop looking matchingInjector = &*agent; break; diff --git a/eve/src/main.cpp b/eve/src/main.cpp index b03a0b567a..61521df9b1 100644 --- a/eve/src/main.cpp +++ b/eve/src/main.cpp @@ -37,6 +37,8 @@ const float EVE_PELVIS_HEIGHT = 0.565925f; const float AUDIO_INJECT_PROXIMITY = 0.4f; const int EVE_VOLUME_BYTE = 190; +const char EVE_AUDIO_FILENAME[] = "/etc/highfidelity/eve/resources/eve.raw""; + bool stopReceiveAgentDataThread; void *receiveAgentData(void *args) { @@ -114,7 +116,7 @@ int main(int argc, const char* argv[]) { AudioInjectionManager::setInjectorSocket(agentList->getAgentSocket()); // read eve's audio data - AudioInjector eveAudioInjector("/etc/highfidelity/eve/resources/eve.raw"); + AudioInjector eveAudioInjector(EVE_AUDIO_FILENAME); // lower Eve's volume by setting the attentuation modifier (this is a value out of 255) eveAudioInjector.setVolume(EVE_VOLUME_BYTE);