mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio/internal/readerdriver: Disable operations when an error is recorded
This commit is contained in:
parent
7eeaef7ff8
commit
f9b8238cd6
@ -213,6 +213,9 @@ func (p *playerImpl) Play() {
|
||||
p.cond.L.Lock()
|
||||
defer p.cond.L.Unlock()
|
||||
|
||||
if p.err != nil {
|
||||
return
|
||||
}
|
||||
if p.state != playerPaused {
|
||||
return
|
||||
}
|
||||
@ -318,6 +321,9 @@ func (p *playerImpl) Pause() {
|
||||
p.cond.L.Lock()
|
||||
defer p.cond.L.Unlock()
|
||||
|
||||
if p.err != nil {
|
||||
return
|
||||
}
|
||||
if p.state != playerPlay {
|
||||
return
|
||||
}
|
||||
@ -341,6 +347,9 @@ func (p *playerImpl) Reset() {
|
||||
p.cond.L.Lock()
|
||||
defer p.cond.L.Unlock()
|
||||
|
||||
if p.err != nil {
|
||||
return
|
||||
}
|
||||
if p.state == playerClosed {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user