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