From e0bc85e790d64f62190c03f40412c3c4cbbda5c0 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 4 Jun 2017 03:44:39 +0900 Subject: [PATCH] audio/vorbis: Cause runtime.Gosched more often --- audio/vorbis/vorbis.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/audio/vorbis/vorbis.go b/audio/vorbis/vorbis.go index 23023e6ab..1c0c7195e 100644 --- a/audio/vorbis/vorbis.go +++ b/audio/vorbis/vorbis.go @@ -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,10 +86,7 @@ func (d *decoded) readUntil(posInBytes int) error { if err != nil { return err } - c++ - if c%2 == 0 { - runtime.Gosched() - } + runtime.Gosched() } return nil }