1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 20:29:42 +00:00

Relaxed a little to allow +10% in track length.

This commit is contained in:
Thomas Harte 2017-08-17 21:36:14 -04:00
parent dc0ca83003
commit 0c1714b695

View File

@ -175,7 +175,10 @@ template<class T> std::shared_ptr<Storage::Disk::Track>
}
while(segment.data.size() < expected_track_bytes) shifter.add_byte(0x00);
if(segment.data.size() > expected_track_bytes) segment.data.resize(expected_track_bytes);
// Allow the amount of data written to be up to 10% more than the expected size. Which is generous.
size_t max_size = expected_track_bytes + (expected_track_bytes / 10);
if(segment.data.size() > max_size) segment.data.resize(max_size);
segment.number_of_bits = (unsigned int)(segment.data.size() * 8);
return std::shared_ptr<Storage::Disk::Track>(new Storage::Disk::PCMTrack(std::move(segment)));