audio/vorbis: Cause runtime.Gosched more often

This commit is contained in:
Hajime Hoshi 2017-06-04 03:44:39 +09:00
parent cf452bb709
commit e0bc85e790

View File

@ -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
}