audio: refactoring

This commit is contained in:
Hajime Hoshi 2023-07-30 17:04:58 +09:00
parent 5f1d1ec412
commit 335dab9175

View File

@ -224,12 +224,11 @@ func (c *Context) IsReady() bool {
c.m.Lock()
defer c.m.Unlock()
r := c.ready
if r {
return r
if c.ready {
return true
}
if len(c.players) != 0 {
return r
return false
}
c.readyOnce.Do(func() {
@ -245,7 +244,7 @@ func (c *Context) IsReady() bool {
}()
})
return r
return false
}
// SampleRate returns the sample rate.