summaryrefslogtreecommitdiffstats
path: root/src/EtiReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/EtiReader.cpp')
-rw-r--r--src/EtiReader.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/EtiReader.cpp b/src/EtiReader.cpp
index b61481c..fe54f55 100644
--- a/src/EtiReader.cpp
+++ b/src/EtiReader.cpp
@@ -2,8 +2,10 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty
the Queen in Right of Canada (Communications Research Center Canada)
- Includes modifications for which no copyright is claimed
- 2012, Matthias P. Braendli, matthias.braendli@mpb.li
+ Copyright (C) 2014
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -269,18 +271,17 @@ int EtiReader::process(Buffer* dataIn)
}
break;
default:
- // throw std::runtime_error("Invalid state!");
+ // throw std::runtime_error("Invalid state!");
PDEBUG("Invalid state (%i)!", state);
input_size = 0;
}
}
-
+
// Update timestamps
myTimestampDecoder.updateTimestampEti(eti_fc.FP & 0x3,
- eti_eoh.MNSC,
- getPPSOffset());
+ eti_eoh.MNSC, getPPSOffset(), eti_fc.FCT);
- if (getFCT() % 125 == 0) //every 3 seconds is fine enough
+ if (eti_fc.FCT % 125 == 0) //every 3 seconds is fine enough
{
myTimestampDecoder.updateModulatorOffset();
}
@@ -296,17 +297,15 @@ bool EtiReader::sourceContainsTimestamp()
double EtiReader::getPPSOffset()
{
- if (!sourceContainsTimestamp())
+ if (!sourceContainsTimestamp()) {
+ //fprintf(stderr, "****** SOURCE NO TS\n");
return 0.0;
+ }
uint32_t timestamp = ntohl(eti_tist.TIST) & 0xFFFFFF;
- //fprintf(stderr, "TIST 0x%x\n", timestamp);
+ //fprintf(stderr, "****** TIST 0x%x\n", timestamp);
double pps = timestamp / 16384000.0; // seconds
return pps;
}
-uint32_t EtiReader::getFCT()
-{
- return eti_fc.FCT;
-}