From eb036357a67ddea95ede76c154f1dd33d2bc4f0a Mon Sep 17 00:00:00 2001
From: Jef Driesen <jefdriesen@users.sourceforge.net>
Date: Tue, 8 Jul 2014 21:18:41 +0200
Subject: [PATCH] Ignore excess samples with the same timestamp.

With a time based sample interval, the maximum number of samples for a
single timestamp should be constant. However in practice some devices
occasionally store one or more additional samples with the same
timestamp.

Ignoring those excess samples, allows the parser to proceed, while still
preserving the strict time based interval for the application.
---
 src/oceanic_vtpro_parser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/oceanic_vtpro_parser.c b/src/oceanic_vtpro_parser.c
index c67483c..be327b0 100644
--- a/src/oceanic_vtpro_parser.c
+++ b/src/oceanic_vtpro_parser.c
@@ -281,8 +281,9 @@ oceanic_vtpro_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_
 				return DC_STATUS_DATAFORMAT;
 			}
 			if (i >= count) {
-				ERROR (abstract->context, "Unexpected number of samples with the same timestamp.");
-				return DC_STATUS_DATAFORMAT;
+				WARNING (abstract->context, "Unexpected sample with the same timestamp ignored.");
+				offset += PAGESIZE / 2;
+				continue;
 			}
 		}
 
-- 
1.9.1

