mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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 := 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
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user