CueParser: Ignore pregap when index 0 is specified

Also corrects the previous track length when index 0 is specified.
This commit is contained in:
Connor McLaughlin 2021-05-23 20:42:49 +10:00
parent 8f639070c9
commit 16efffa403
1 changed files with 6 additions and 1 deletions

View File

@ -452,7 +452,12 @@ bool File::SetTrackLengths(u32 line_number, Common::Error* error)
return false;
}
previous_track->length = MSF::FromLBA(track.start.ToLBA() - previous_track->start.ToLBA());
// Use index 0, otherwise index 1.
const MSF* start_index = track.GetIndex(0);
if (!start_index)
start_index = track.GetIndex(1);
previous_track->length = MSF::FromLBA(start_index->ToLBA() - previous_track->start.ToLBA());
}
}
}