loop: Bug fix: Revert audio-clock syncing

This commit is contained in:
Hajime Hoshi 2017-08-05 23:49:11 +09:00
parent d99638d34c
commit 288a7ede8d

View File

@ -89,15 +89,13 @@ func (c *runContext) updateCount(now int64) int {
return 0 return 0
} }
if clock.IsValid() { if clock.IsValid() && c.lastClockFrame != clock.Now() {
if c.lastClockFrame != clock.Now() { sync = true
sync = true f := clock.Now()
f := clock.Now() if c.frames < f {
if c.frames < f { count = int(f - c.frames)
count = int(f - c.frames)
}
c.lastClockFrame = f
} }
c.lastClockFrame = f
} else { } else {
if t > 5*int64(time.Second)/int64(FPS) { if t > 5*int64(time.Second)/int64(FPS) {
// The previous time is too old. Let's assume that the window was unfocused. // The previous time is too old. Let's assume that the window was unfocused.