audio/internal/readerdriver: Bug fix: AudioQueueFlush was not needed

Rather, AudioQueueFlush after AudioQueueReset might cause an error.

Closes #1644
This commit is contained in:
Hajime Hoshi 2021-05-15 22:47:06 +09:00
parent 81015a3c19
commit 49172a235b

View File

@ -475,10 +475,6 @@ func (p *playerImpl) Reset() {
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueReset failed: %d", osstatus)) p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueReset failed: %d", osstatus))
return return
} }
if osstatus := C.AudioQueueFlush(p.audioQueue); osstatus != C.noErr && p.err == nil {
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueFlush failed: %d", osstatus))
return
}
p.state = playerPaused p.state = playerPaused
p.buf = p.buf[:0] p.buf = p.buf[:0]