mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user