audio/internal/go2cpp: Better waiting condition

This commit is contained in:
Hajime Hoshi 2021-01-11 15:37:40 +09:00
parent dc8217dfeb
commit 9cc5bd80f9

View File

@ -142,7 +142,7 @@ func (p *Player) waitUntilUnpaused() bool {
p.cond.L.Lock() p.cond.L.Lock()
defer p.cond.L.Unlock() defer p.cond.L.Unlock()
for p.state == playerStatePaused || !p.v.Call("isWritable").Bool() { for p.state == playerStatePaused || (p.state == playerStatePlaying && !p.v.Call("isWritable").Bool()) {
p.cond.Wait() p.cond.Wait()
} }
return p.state == playerStatePlaying return p.state == playerStatePlaying