mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 20:28:54 +01:00
audio: skip making a player at SetPosition when possible
This commit is contained in:
parent
eccf67172f
commit
788529ff76
@ -262,6 +262,10 @@ func (p *playerImpl) SetPosition(offset time.Duration) error {
|
|||||||
p.m.Lock()
|
p.m.Lock()
|
||||||
defer p.m.Unlock()
|
defer p.m.Unlock()
|
||||||
|
|
||||||
|
if offset == 0 && p.player == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
if err := p.ensurePlayer(); err != nil {
|
if err := p.ensurePlayer(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user