Skip to content

Commit

Permalink
Fix formula for the number of chunks.
Browse files Browse the repository at this point in the history
It was rounding to the nearest boundary as opposed to rounding up. This
caused the last chunk to not always be downloaded.
  • Loading branch information
plietar committed Dec 30, 2015
1 parent 654a403 commit 525b27d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/audio_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 525b27d

Please sign in to comment.