diff --git a/src/output/Timer.cxx b/src/output/Timer.cxx index 8e1b6ee7e..cf7532c9c 100644 --- a/src/output/Timer.cxx +++ b/src/output/Timer.cxx @@ -27,8 +27,7 @@ #include Timer::Timer(const AudioFormat af) - : time(0), - started(false), + :started(false), rate(af.sample_rate * af.GetFrameSize()) { } @@ -41,7 +40,6 @@ void Timer::Start() void Timer::Reset() { - time = 0; started = false; } @@ -56,6 +54,8 @@ void Timer::Add(int size) unsigned Timer::GetDelay() const { + assert(started); + int64_t delay = (int64_t)(time - MonotonicClockUS()) / 1000; if (delay < 0) return 0;