diff options
author | Nick Pelly <npelly@google.com> | 2009-12-17 03:12:26 -0800 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2009-12-17 03:12:26 -0800 |
commit | 60e8a3334a826bdfacb74231a343227981f2e380 (patch) | |
tree | 2b00356cde077cec53365fd1362ac4f8424e5f22 | |
parent | f3002f064c3f20af793e83f1de02647ebc6f2037 (diff) | |
download | bluez-eclair-release.tar.gz |
Use monotonically increasing clock for A2DP timing.android-sdk-2.1_r1android-2.1_r2.1sandroid-2.1_r2.1p2android-2.1_r2.1pandroid-2.1_r2android-2.1_r1eclair-sholes-release2eclair-releaseeclair-passion-release
This is to avoid skips when the system time changes.
-rwxr-xr-x | audio/liba2dp.c | 6 |
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 |