mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
audio/internal/readerdriver: Bug fix: An error was overwritten
This commit is contained in:
parent
ae14caee93
commit
e43dcc2265
@ -537,13 +537,13 @@ func (p *playerImpl) closeImpl() error {
|
||||
osstatus := C.AudioQueueStop(q, C.true)
|
||||
p.cond.L.Lock()
|
||||
|
||||
if osstatus != C.noErr && p.err != nil {
|
||||
if osstatus != C.noErr && p.err == nil {
|
||||
// setErrorImpl calls closeImpl. Do not call this.
|
||||
p.err = fmt.Errorf("readerdriver: AudioQueueStop failed: %d", osstatus)
|
||||
}
|
||||
|
||||
// All the AudioQueueBuffers are already dequeued. It is safe to dispose the AudioQueue and its buffers.
|
||||
if err := p.context.audioQueuePool.Put(p.audioQueue); err != nil && p.err != nil {
|
||||
if err := p.context.audioQueuePool.Put(p.audioQueue); err != nil && p.err == nil {
|
||||
p.err = err
|
||||
}
|
||||
thePlayers.remove(p.audioQueue)
|
||||
|
Loading…
Reference in New Issue
Block a user