Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 9316)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 9317)
@@ -158,5 +158,7 @@
   }
 
-  if (ephOld == 0 || newEph->isNewerThan(ephOld)) {
+  if ( (ephOld == 0) ||
+       newEph->isNewerThan(ephOld) ||
+       newCorrectedGpsEphSet(newEph)  ) {
     checkEphemeris(newEph, realTime);
     eph->setCheckState(newEph->checkState());
@@ -170,18 +172,11 @@
       newEph->checkState() != t_eph::outdated) {
     deque<t_eph*>& qq = _eph[prn];
-    if (qq.empty() ||
-        newEph->isNewerThan(qq.back())){
-      qq.push_back(newEph);
-      if (qq.size() > _maxQueueSize) {
-        delete qq.front();
-        qq.pop_front();
-      }
-      ephBufferChanged();
-      return success;
-    }
-    else {
-      delete newEph;
-      return failure;
-    }
+    qq.push_back(newEph);
+    if (qq.size() > _maxQueueSize) {
+      delete qq.front();
+      qq.pop_front();
+    }
+    ephBufferChanged();
+    return success;
   }
   else {
@@ -279,13 +274,11 @@
     ColumnVector vvL(3);
     ephL->getCrd(eph->TOC(), xcL, vvL, false);
-    double dt = eph->TOC() - ephL->TOC();
-    if (dt < 0.0) {
-      dt += 604800.0;
-    }
+
     double diff  = (xc.Rows(1,3) - xcL.Rows(1,3)).NormFrobenius();
     double diffC = fabs(xc(4) - xcL(4)) * t_CST::c;
 
     if (diff < MAXDIFF && diffC < MAXDIFF) {
-      if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) {
+      if (diff < MINDIFF && diffC < MINDIFF &&
+          ephL->checkState() == t_eph::ok) {
         // to prevent the same data sets with different TOC values
         eph->setCheckState(t_eph::bad);
@@ -301,6 +294,11 @@
       }
     }
+
+    double dt = eph->TOC() - ephL->TOC();
     // some lines to allow update of ephemeris data sets after an outage
+    // -----------------------------------------------------------------
     // update interval: 2h,
+    // sometimes corrected BRDC sets are sent with TOC values 16 seconds
+    // before the nominal TOC (integer time)
     if      (eph->type() == t_eph::GPS     && dt > (2*3600.0 + 60.0)) {
       ephL->setCheckState(t_eph::outdated);
@@ -313,5 +311,5 @@
     }
     // updated every 30 minutes
-    else if (eph->type() == t_eph::GLONASS && dt > (1800.0 + 60.0)) {
+    else if (eph->type() == t_eph::GLONASS && dt > (  1800.0 + 60.0)) {
       ephL->setCheckState(t_eph::outdated);
       return;
@@ -339,2 +337,38 @@
   }
 }
+
+//
+////////////////////////////////////////////////////////////////////////////
+bool bncEphUser::newCorrectedGpsEphSet(t_eph* eph) {
+
+  bool correctedGpsEphSet = false;
+  bool newCorrectedGpsEphSet = false;
+
+  if (eph->prn().system() != 'G') {
+    return newCorrectedGpsEphSet;
+  }
+
+  if ((fmod(eph->TOC().daysec()+16.0, 7200) == 0.0)) {
+    // sometimes corrected BRDC sets are sent with TOC values 16 seconds
+    // before the nominal TOC (integer time)
+    correctedGpsEphSet = true;
+  }
+
+  QString      prn     = QString(eph->prn().toInternalString().c_str());
+  t_eph*       ephL    = ephLast(prn);
+  if (!ephL) { // first set for GPS Sat
+    return correctedGpsEphSet;
+  }
+
+
+  double dt = eph->TOC() - ephL->TOC();
+  if (correctedGpsEphSet){
+    if (dt == 0.0) {
+      newCorrectedGpsEphSet = false;
+    }
+    else {
+      newCorrectedGpsEphSet = true;
+    }
+  }
+  return  newCorrectedGpsEphSet;
+}
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 9316)
+++ /trunk/BNC/src/bncephuser.h	(revision 9317)
@@ -75,4 +75,5 @@
  private:
   void checkEphemeris(t_eph* eph, bool realTime);
+  bool newCorrectedGpsEphSet(t_eph* eph);
   QMutex                             _mutex;
   static const unsigned              _maxQueueSize = 6;
