Permalink
Browse files

audio: measuring feed time more accurately

  • Loading branch information...
fzurita committed Feb 27, 2016
1 parent 374b468 commit 35d665d3574584c7cb597300db63846338e550e8
Showing with 3 additions and 2 deletions.
  1. +3 −2 jni/mupen64plus-audio-sles/main.cpp
@@ -826,13 +826,14 @@ void* audioConsumer(void* param)
ranDry = queueLength < minQueueSize;
struct threadmsg msg;
+
+ clock_gettime(CLOCK_REALTIME, &prevTime);
int result = thread_queue_get(&audioConsumerQueue, &waitTime, &msg);
+ clock_gettime(CLOCK_REALTIME, &currTime);
if( result != ETIMEDOUT )
{
//Figure out how much to slow down by
- prevTime = currTime;
- clock_gettime(CLOCK_REALTIME, &currTime);
float timeDiff = TimeDiff(&currTime, &prevTime);
feedTimes[feedTimeIndex] = timeDiff;

0 comments on commit 35d665d

Please sign in to comment.