audio/vorbis: Catch the Seek error

This commit is contained in:
Hajime Hoshi 2021-05-03 23:11:14 +09:00
parent fc5970768d
commit 11e76d3fc8

View File

@ -106,7 +106,9 @@ func (d *decoded) Seek(offset int64, whence int) (int64, error) {
// pos should be always even // pos should be always even
next = next / 2 * 2 next = next / 2 * 2
d.posInBytes = int(next) d.posInBytes = int(next)
d.decoder.SetPosition(next / int64(d.decoder.Channels()) / 2) if err := d.decoder.SetPosition(next / int64(d.decoder.Channels()) / 2); err != nil {
return 0, err
}
d.decoderr = nil d.decoderr = nil
return next, nil return next, nil
} }