+ if (lostEventsInThisPacket != 0) {
+ hasLost = true;
+ /*
+ * Compute the duration of the lost event time range. If the
+ * current packet is the first packet, duration will be set
+ * to 1.
+ */
+ long lostEventsStartTime;
+ int index = this.streamInputReader.getStreamInput().getIndex().getEntries().indexOf(currentPacket);
+ if (index == 0) {
+ lostEventsStartTime = currentPacket.getTimestampBegin() + 1;
+ } else {
+ prevPacket = this.streamInputReader.getStreamInput().getIndex().getEntries().get(index - 1);
+ lostEventsStartTime = prevPacket.getTimestampEnd();
+ }
+ lostEventsDuration = Math.abs(lostEventsStartTime - currentPacket.getTimestampBegin());
+ }