change file offsets according to blocks

This commit is contained in:
nikk gitanes
2021-08-20 03:45:48 +03:00
parent c30a4473f8
commit e609739d4f
2 changed files with 15 additions and 6 deletions

View File

@@ -63,7 +63,11 @@ func (t *Torrent) Preload(index int, size int64) {
}
}()
mb5 := int64(5 * 1024 * 1024)
// mb5 -> 8/16 MB
mb5 := int64(t.Info().PieceLength)
if (mb5 < 8 * 1024 * 1024) {
mb5 = 8 * 1024 * 1024
}
readerStart := file.NewReader()
defer readerStart.Close()