audio: bug fix: suspend/resume didn't return an error

This was removed at a93897d9d2 accidentally.

Updates #1665
This commit is contained in:
Hajime Hoshi 2022-08-31 12:11:50 +09:00
parent 2d43e59b37
commit b53c686017

View File

@ -111,12 +111,16 @@ func NewContext(sampleRate int) *Context {
h := getHook() h := getHook()
h.OnSuspendAudio(func() error { h.OnSuspendAudio(func() error {
c.semaphore <- struct{}{} c.semaphore <- struct{}{}
c.playerFactory.suspend() if err := c.playerFactory.suspend(); err != nil {
return err
}
return nil return nil
}) })
h.OnResumeAudio(func() error { h.OnResumeAudio(func() error {
<-c.semaphore <-c.semaphore
c.playerFactory.resume() if err := c.playerFactory.resume(); err != nil {
return err
}
return nil return nil
}) })