CHD: Only pad when version >= 5

This commit is contained in:
Christoph "baka0815" Schwerdtfeger 2018-10-30 20:38:19 +01:00
parent 98c1e7253c
commit 6f358ebf8f
1 changed files with 5 additions and 2 deletions

View File

@ -158,8 +158,11 @@ bool CHDDisc::TryOpen(const wchar* file)
t.ADDR = 0;
t.CTRL = strcmp(type,"AUDIO") == 0 ? 0 : 4;
t.file = new CHDTrack(this, t.StartFAD, total_hunks, strcmp(type,"MODE1") ? 2352 : 2048, extraframes);
int padded = (frames + CD_TRACK_PADDING - 1) / CD_TRACK_PADDING;
extraframes += (padded * CD_TRACK_PADDING) - frames;
if (head->version >= 5)
{
int padded = (frames + CD_TRACK_PADDING - 1) / CD_TRACK_PADDING;
extraframes += (padded * CD_TRACK_PADDING) - frames;
}
total_hunks += frames / sph;
if (frames % sph)