mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
audio/vorbis: Unretain the Ogg decoder after decoding is done (#733)
This commit is contained in:
parent
959c6511dd
commit
eda8d61413
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user