audi/internal/conver: Fix ring-buffer-like slice usages

This commit is contained in:
Hajime Hoshi 2021-09-12 17:06:36 +09:00
parent 335fefa4fd
commit 7422a3353a

View File

@ -137,7 +137,8 @@ func (r *Resampling) src(i int64) (float64, float64, error) {
p := r.lruSrcBlocks[0]
delete(r.srcBufL, p)
delete(r.srcBufR, p)
r.lruSrcBlocks = r.lruSrcBlocks[1:]
copy(r.lruSrcBlocks, r.lruSrcBlocks[1:])
r.lruSrcBlocks = r.lruSrcBlocks[:len(r.lruSrcBlocks)-1]
}
r.lruSrcBlocks = append(r.lruSrcBlocks, r.srcBlock)
} else {