mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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 {
|
||||
return errors.New("driver: p.alBuffers must > 0")
|
||||
// This can happen (#207)
|
||||
return nil
|
||||
}
|
||||
buf := p.alBuffers[0]
|
||||
p.alBuffers = p.alBuffers[1:]
|
||||
|
@ -116,7 +116,8 @@ func (p *Player) Proceed(data []byte) error {
|
||||
}
|
||||
}
|
||||
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 {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user