mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio/vorbis: Cause runtime.Gosched more often
This commit is contained in:
parent
cf452bb709
commit
e0bc85e790
@ -63,7 +63,6 @@ type decoded struct {
|
||||
}
|
||||
|
||||
func (d *decoded) readUntil(posInBytes int) error {
|
||||
c := 0
|
||||
buffer := make([]float32, 8192)
|
||||
for d.readBytes < posInBytes {
|
||||
n, err := d.decoder.Read(buffer)
|
||||
@ -87,11 +86,8 @@ func (d *decoded) readUntil(posInBytes int) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c++
|
||||
if c%2 == 0 {
|
||||
runtime.Gosched()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user