Revert "audio: Seek the source first at readerPlayer"

This reverts commit 68f12f066e.

Reason: Some data can be read after seeking before resetting
This commit is contained in:
Hajime Hoshi 2021-01-13 02:01:00 +09:00
parent 68f12f066e
commit 78789a511c

View File

@ -134,11 +134,8 @@ func (p *readerPlayer) Seek(offset time.Duration) error {
p.m.Lock() p.m.Lock()
defer p.m.Unlock() defer p.m.Unlock()
if err := p.src.Seek(offset); err != nil {
return err
}
p.player.Reset() p.player.Reset()
return nil return p.src.Seek(offset)
} }
func (p *readerPlayer) source() io.Reader { func (p *readerPlayer) source() io.Reader {