From 272efcbdc4abd9b951e668e3f591eda521714492 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Mon, 12 Jan 2015 01:00:05 +0000 Subject: [PATCH] Fix thinko in skipping over decoded message samples. --- mode_s.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mode_s.c b/mode_s.c index 9aae7fc..737b480 100644 --- a/mode_s.c +++ b/mode_s.c @@ -2335,8 +2335,13 @@ void detectModeS_oversample(uint16_t *m, uint32_t mlen) { } // Skip this message if we are sure it's fine + // (we actually skip to 8 bits before the end of the message, + // because we can often decode two messages that *almost* collide, + // where the preamble of the second message clobbered the last + // few bits of the first message, but the message bits didn't + // overlap) if (mm.crcok || mm.correctedbits) { - j += (16+msglen)*6/5 - 1; + j += (8 + msglen - 8)*12/5 - 1; } // Pass data to the next layer