mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 02:03:36 +02:00
Removed gettimeofday in AudioMixer
This commit is contained in:
parent
8cfc8faa01
commit
dd8a0e3550
1 changed files with 3 additions and 4 deletions
|
@ -389,9 +389,8 @@ void AudioMixer::run() {
|
|||
nodeList->linkedDataCreateCallback = attachNewBufferToNode;
|
||||
|
||||
int nextFrame = 0;
|
||||
timeval startTime;
|
||||
|
||||
gettimeofday(&startTime, NULL);
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
||||
char* clientMixBuffer = new char[NETWORK_BUFFER_LENGTH_BYTES_STEREO
|
||||
+ numBytesForPacketHeaderGivenPacketType(PacketTypeMixedAudio)];
|
||||
|
@ -490,7 +489,7 @@ void AudioMixer::run() {
|
|||
break;
|
||||
}
|
||||
|
||||
usecToSleep = usecTimestamp(&startTime) + (++nextFrame * BUFFER_SEND_INTERVAL_USECS) - usecTimestampNow();
|
||||
usecToSleep = (++nextFrame * BUFFER_SEND_INTERVAL_USECS) - timer.nsecsElapsed() / 1000; // ns to us
|
||||
|
||||
if (usecToSleep > 0) {
|
||||
usleep(usecToSleep);
|
||||
|
|
Loading…
Reference in a new issue