audio: don't create an underlying player at Position

This is simply unnecessary.
This commit is contained in:
Hajime Hoshi 2024-02-01 17:17:50 +09:00
parent b9f0db955c
commit d1ec00e2ba

View File

@ -245,8 +245,8 @@ func (p *playerImpl) Close() error {
func (p *playerImpl) Position() time.Duration {
p.m.Lock()
defer p.m.Unlock()
if err := p.ensurePlayer(); err != nil {
p.context.setError(err)
if p.player == nil {
return 0
}