aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2009-12-17 03:12:26 -0800
committerNick Pelly <npelly@google.com>2009-12-17 03:12:26 -0800
commit60e8a3334a826bdfacb74231a343227981f2e380 (patch)
tree2b00356cde077cec53365fd1362ac4f8424e5f22
parentf3002f064c3f20af793e83f1de02647ebc6f2037 (diff)
downloadbluez-eclair-release.tar.gz
This is to avoid skips when the system time changes.
-rwxr-xr-xaudio/liba2dp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/liba2dp.c b/audio/liba2dp.c
index 5f069e51..9dfcf8ba 100755
--- a/audio/liba2dp.c
+++ b/audio/liba2dp.c
@@ -153,9 +153,9 @@ struct bluetooth_data {
static uint64_t get_microseconds()
{
- struct timeval now;
- gettimeofday(&now, NULL);
- return (now.tv_sec * 1000000UL + now.tv_usec);
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ return (now.tv_sec * 1000000UL + now.tv_nsec / 1000UL);
}
#ifdef ENABLE_TIMING