Fix indexes from CloneCD disc images. Fixes #374.

This commit is contained in:
2020-11-04 02:36:31 +00:00
parent 0fc3d4e1c2
commit 6b741992af

View File

@@ -433,8 +433,6 @@ namespace Aaru.DiscImages
Tracks.Add(currentTrack);
}
else
firstTrackInSession = false;
currentTrack = new Track
{
@@ -449,6 +447,23 @@ namespace Aaru.DiscImages
TrackSession = descriptor.SessionNumber
};
if(firstTrackInSession)
{
currentTrack.TrackPregap = 150;
if(currentTrack.TrackStartSector > 0)
{
currentTrack.Indexes[0] = (int)currentTrack.TrackStartSector - 150;
if(currentTrack.Indexes[0] < 0)
currentTrack.Indexes[0] = 0;
}
}
currentTrack.Indexes[1] = (int)currentTrack.TrackStartSector;
firstTrackInSession = false;
// Need to check exact data type later
if((TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrack ||
(TocControl)(descriptor.CONTROL & 0x0D) == TocControl.DataTrackIncremental)