mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
audio/internal/readerdriver: Bug fix: Race condition on macOS/iOS
Updates #1680
This commit is contained in:
parent
301515f44b
commit
47dfba69a5
@ -704,11 +704,8 @@ func (p *playerImpl) readSourceToBuffer() {
|
||||
return
|
||||
}
|
||||
|
||||
src := p.src
|
||||
p.m.Unlock()
|
||||
buf := make([]byte, maxBufferSize)
|
||||
n, err := src.Read(buf)
|
||||
p.m.Lock()
|
||||
n, err := p.src.Read(buf)
|
||||
|
||||
if err != nil && err != io.EOF {
|
||||
p.setError(err)
|
||||
|
Loading…
Reference in New Issue
Block a user