mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 20:42:07 +01:00
audio/internal/readerdriver: Bug fix: Race condition on UNIX/Linux
Updates #1680
This commit is contained in:
parent
c7ac5a32b5
commit
ab5f5cbfea
@ -358,11 +358,8 @@ func (p *playerImpl) readSourceToBuffer() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
src := p.src
|
|
||||||
p.m.Unlock()
|
|
||||||
buf := make([]byte, maxBufferSize)
|
buf := make([]byte, maxBufferSize)
|
||||||
n, err := src.Read(buf)
|
n, err := p.src.Read(buf)
|
||||||
p.m.Lock()
|
|
||||||
|
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF {
|
||||||
p.setErrorImpl(err)
|
p.setErrorImpl(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user