mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
audio: Avoid busy loops (#183)
This commit is contained in:
parent
b1f856a0e0
commit
8b8eb855a7
@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"time"
|
||||||
|
|
||||||
"golang.org/x/mobile/exp/audio/al"
|
"golang.org/x/mobile/exp/audio/al"
|
||||||
)
|
)
|
||||||
@ -90,6 +91,9 @@ func (p *player) proceed() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if n == 0 {
|
||||||
|
time.Sleep(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.alSource.State() == al.Stopped {
|
if p.alSource.State() == al.Stopped {
|
||||||
|
Loading…
Reference in New Issue
Block a user