mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +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()
|
||||
defer p.m.Unlock()
|
||||
|
||||
if offset == 0 && p.player == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := p.ensurePlayer(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user