浏览代码

Fix formula for the number of chunks.

It was rounding to the nearest boundary as opposed to rounding up. This
caused the last chunk to not always be downloaded.
Paul Lietar 9 年之前
父节点
当前提交
525b27df98
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/audio_file.rs

+ 1 - 1
src/audio_file.rs

@@ -53,7 +53,7 @@ impl AudioFileLoading {
                 }
             }).next().unwrap();
 
-        let chunk_count = (size + CHUNK_SIZE / 2) / CHUNK_SIZE;
+        let chunk_count = (size + CHUNK_SIZE - 1) / CHUNK_SIZE;
 
         let shared = Arc::new(AudioFileShared {
             file_id: file_id,