audio/vorbis: Unretain the Ogg decoder after decoding is done (#733)

This commit is contained in:
Hajime Hoshi 2018-11-09 03:46:00 +09:00
parent 959c6511dd
commit eda8d61413

View File

@ -78,6 +78,10 @@ type decoded struct {
}
func (d *decoded) readUntil(posInBytes int) error {
if d.decoder == nil {
return nil
}
buffer := make([]float32, 8192)
for d.readBytes < posInBytes {
n, err := d.decoder.Read(buffer)
@ -93,6 +97,7 @@ func (d *decoded) readUntil(posInBytes int) error {
d.readBytes += n * 2
}
if err == io.EOF {
d.decoder = nil
break
}
if err != nil {