diff --git a/src/suunto_d9_parser.c b/src/suunto_d9_parser.c index 939dab6..e71a60f 100644 --- a/src/suunto_d9_parser.c +++ b/src/suunto_d9_parser.c @@ -502,6 +502,7 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca unsigned int he, o2; unsigned int length; + sample.event.type = SAMPLE_EVENT_NONE; sample.event.time = 0; sample.event.flags = 0; sample.event.value = 0; @@ -634,7 +635,9 @@ suunto_d9_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t ca else sample.event.flags = SAMPLE_FLAGS_BEGIN; sample.event.time = seconds; - if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + if (sample.event.type != SAMPLE_EVENT_NONE) { + if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + } offset += 2; break; case 0x04: // Bookmark/Heading diff --git a/src/suunto_eon_parser.c b/src/suunto_eon_parser.c index f89fe2a..534b847 100644 --- a/src/suunto_eon_parser.c +++ b/src/suunto_eon_parser.c @@ -292,6 +292,7 @@ suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c complete = 1; } else { // Event. + sample.event.type = SAMPLE_EVENT_NONE; sample.event.time = 0; sample.event.flags = 0; sample.event.value = 0; @@ -313,7 +314,9 @@ suunto_eon_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t c break; } - if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + if (sample.event.type != SAMPLE_EVENT_NONE) { + if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + } } } diff --git a/src/suunto_vyper_parser.c b/src/suunto_vyper_parser.c index c0618e8..910670f 100644 --- a/src/suunto_vyper_parser.c +++ b/src/suunto_vyper_parser.c @@ -346,6 +346,7 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t complete = 1; } else { // Event. + sample.event.type = SAMPLE_EVENT_NONE; sample.event.time = 0; sample.event.flags = 0; sample.event.value = 0; @@ -382,7 +383,9 @@ suunto_vyper_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t break; } - if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + if (sample.event.type != SAMPLE_EVENT_NONE) { + if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + } } }