mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:25:52 +02:00
output difference in time since last send for debug
This commit is contained in:
parent
8035471fa4
commit
0cfc2dae52
1 changed files with 4 additions and 0 deletions
|
@ -144,6 +144,7 @@ void *send_buffer_thread(void *args)
|
||||||
int sentBytes;
|
int sentBytes;
|
||||||
int currentFrame = 1;
|
int currentFrame = 1;
|
||||||
timeval startTime;
|
timeval startTime;
|
||||||
|
timeval lastSend;
|
||||||
timeval now;
|
timeval now;
|
||||||
|
|
||||||
int16_t *clientMix = new int16_t[BUFFER_LENGTH_SAMPLES];
|
int16_t *clientMix = new int16_t[BUFFER_LENGTH_SAMPLES];
|
||||||
|
@ -157,6 +158,8 @@ void *send_buffer_thread(void *args)
|
||||||
while (usecTimestamp(&startTime, (currentFrame * BUFFER_SEND_INTERVAL_USECS)) <= usecTimestamp(&now)) {
|
while (usecTimestamp(&startTime, (currentFrame * BUFFER_SEND_INTERVAL_USECS)) <= usecTimestamp(&now)) {
|
||||||
sentBytes = 0;
|
sentBytes = 0;
|
||||||
|
|
||||||
|
std::cout << "The difference was " << diffclock(lastSend, now) << "ms.\n";
|
||||||
|
|
||||||
int sampleOffset = ((currentFrame - 1) * BUFFER_LENGTH_SAMPLES) % whiteNoiseLength;
|
int sampleOffset = ((currentFrame - 1) * BUFFER_LENGTH_SAMPLES) % whiteNoiseLength;
|
||||||
|
|
||||||
memcpy(masterMix, whiteNoiseBuffer + sampleOffset, BUFFER_LENGTH_BYTES);
|
memcpy(masterMix, whiteNoiseBuffer + sampleOffset, BUFFER_LENGTH_BYTES);
|
||||||
|
@ -193,6 +196,7 @@ void *send_buffer_thread(void *args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gettimeofday(&lastSend, NULL);
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue