micropolis: Improve decode a little more.

seekToPattern() can skip the index hole if it doesn't find the
SYNC pattern.  If this happens too close to the end of the flux
stream, it can result in a conflicted sector.  In this case,
discard the sector.
This commit is contained in:
Howard M. Harte
2022-02-25 21:59:18 -08:00
parent 65584a953d
commit 2d4e2b87bc

View File

@@ -103,6 +103,15 @@ public:
clock = seekToPattern(SECTOR_SYNC_PATTERN);
}
_sector->headerStartTime = tell().ns();
/* seekToPattern() can skip past the index hole, if this happens
* too close to the end of the Fluxmap, discard the sector.
*/
if (_sector->headerStartTime > (getFluxmapDuration() - 12.5e6)) {
return 0;
}
return clock;
}