Fix timestamp correction when sample blocks are dropped.

(Fixes #43)
This commit is contained in:
Oliver Jowett 2015-04-08 19:13:40 +01:00
parent 6148a05cef
commit e6c81251bf
2 changed files with 6 additions and 1 deletions

2
debian/changelog vendored
View file

@ -5,6 +5,8 @@ dump1090-mutability (1.15~dev) UNRELEASED; urgency=medium
isn't root. (github issue #24)
* Don't fail on postinst if the given user exists but is outside
the usual system user UID range. (github issue #24)
* Fix timestamp correction when sample blocks are dropped. (github
issue #43)
-- Oliver Jowett <oliver@mutability.co.uk> Thu, 19 Feb 2015 22:39:19 +0000

View file

@ -1065,7 +1065,10 @@ int main(int argc, char **argv) {
// If we lost some blocks, correct the timestamp
if (Modes.iDataLost) {
Modes.timestampBlk += (MODES_ASYNC_BUF_SAMPLES * 6 * Modes.iDataLost);
if (Modes.oversample)
Modes.timestampBlk += (MODES_ASYNC_BUF_SAMPLES * 5 * Modes.iDataLost);
else
Modes.timestampBlk += (MODES_ASYNC_BUF_SAMPLES * 6 * Modes.iDataLost);
Modes.stats_current.blocks_dropped += Modes.iDataLost;
Modes.iDataLost = 0;
}