Use monotonically increasing clock for A2DP timing.
This is to avoid skips when the system time changes.
diff --git a/audio/liba2dp.c b/audio/liba2dp.c
index 5f069e5..9dfcf8b 100755
--- a/audio/liba2dp.c
+++ b/audio/liba2dp.c
@@ -153,9 +153,9 @@
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