mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
audio: Bug fix: buffers might be run out (#207)
This commit is contained in:
parent
e5609f06d6
commit
6ba088d021
@ -110,7 +110,8 @@ func (p *Player) Proceed(data []byte) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(p.alBuffers) == 0 {
|
if len(p.alBuffers) == 0 {
|
||||||
return errors.New("driver: p.alBuffers must > 0")
|
// This can happen (#207)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
buf := p.alBuffers[0]
|
buf := p.alBuffers[0]
|
||||||
p.alBuffers = p.alBuffers[1:]
|
p.alBuffers = p.alBuffers[1:]
|
||||||
|
@ -116,7 +116,8 @@ func (p *Player) Proceed(data []byte) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if headerToWrite == nil {
|
if headerToWrite == nil {
|
||||||
return errors.New("driver: no available buffers")
|
// This can happen (#207)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
if err := headerToWrite.Write(p.out, p.buffer[:bufferSize]); err != nil {
|
if err := headerToWrite.Write(p.out, p.buffer[:bufferSize]); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user