1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Resolves potential overflow / sign corruption.

This commit is contained in:
Thomas Harte 2018-05-19 22:28:29 -04:00
parent 8263c48a1d
commit 7cee3b7449

View File

@ -43,7 +43,7 @@ Storage::Disk::PCMSegment Storage::Disk::track_serialisation(const Track &track,
Time extended_length = next_event.length * length_multiplier + time_error;
time_error.clock_rate = extended_length.clock_rate;
time_error.length = extended_length.length % extended_length.clock_rate;
pll.run_for(Cycles(extended_length.get<int>()));
pll.run_for(Cycles(static_cast<int>(extended_length.get<int64_t>())));
pll.add_pulse();
// If the PLL is now sufficiently primed, restart, and start recording bits this time.