audio: bug fix: position adjustment should not start before ready

Updates #2901
This commit is contained in:
Hajime Hoshi 2024-03-16 22:03:34 +09:00
parent 9cc017412f
commit 9cd525a04e

View File

@ -356,6 +356,10 @@ func (p *playerImpl) updatePosition() {
p.adjustedPosition = 0
return
}
if !p.context.IsReady() {
p.adjustedPosition = 0
return
}
samples := (p.stream.position() - int64(p.player.BufferedSize())) / bytesPerSampleInt16