mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
audio: bug fix: suspend/resume didn't return an error
This was removed at a93897d9d2
accidentally.
Updates #1665
This commit is contained in:
parent
2d43e59b37
commit
b53c686017
@ -111,12 +111,16 @@ func NewContext(sampleRate int) *Context {
|
||||
h := getHook()
|
||||
h.OnSuspendAudio(func() error {
|
||||
c.semaphore <- struct{}{}
|
||||
c.playerFactory.suspend()
|
||||
if err := c.playerFactory.suspend(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
h.OnResumeAudio(func() error {
|
||||
<-c.semaphore
|
||||
c.playerFactory.resume()
|
||||
if err := c.playerFactory.resume(); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user