mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +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 {
|
func (d *decoded) readUntil(posInBytes int) error {
|
||||||
c := 0
|
|
||||||
buffer := make([]float32, 8192)
|
buffer := make([]float32, 8192)
|
||||||
for d.readBytes < posInBytes {
|
for d.readBytes < posInBytes {
|
||||||
n, err := d.decoder.Read(buffer)
|
n, err := d.decoder.Read(buffer)
|
||||||
@ -87,10 +86,7 @@ func (d *decoded) readUntil(posInBytes int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c++
|
runtime.Gosched()
|
||||||
if c%2 == 0 {
|
|
||||||
runtime.Gosched()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user