From a161d404ad23e40472b0f613f619e658766889e1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 28 Dec 2016 22:17:59 +0100 Subject: [PATCH] lib/xiph/OggSerial: use std::chrono::steady_clock --- src/lib/xiph/OggSerial.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/xiph/OggSerial.cxx b/src/lib/xiph/OggSerial.cxx index a186610a7..9f688cb55 100644 --- a/src/lib/xiph/OggSerial.cxx +++ b/src/lib/xiph/OggSerial.cxx @@ -18,10 +18,10 @@ */ #include "OggSerial.hxx" -#include "system/Clock.hxx" #include "Compiler.h" #include +#include static std::atomic_uint next_ogg_serial; @@ -34,7 +34,10 @@ GenerateOggSerial() which is random enough for our use */ /* this code is not race-free, but good enough */ - const unsigned seed = MonotonicClockMS(); + using namespace std::chrono; + const auto now = steady_clock::now().time_since_epoch(); + const auto now_ms = duration_cast(now); + const unsigned seed = now_ms.count(); next_ogg_serial = serial = seed; }