audio/internal/readerdriver: Disable operations when an error is recorded

This commit is contained in:
Hajime Hoshi 2021-05-09 05:58:55 +09:00
parent 7eeaef7ff8
commit f9b8238cd6

View File

@ -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
}