summaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-23 11:00:02 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-23 11:00:02 +0100
commit201d711a1d3dfbe46d622871731005937598e790 (patch)
treee43a95ee027e1be6ca8621f9e2c78aaf932a3421 /src/TimestampDecoder.h
parent674228bedb325384f12602350ab36d075b5509a3 (diff)
parente0abfc3728fb56519fa2507d2468214e2a633c98 (diff)
downloaddabmod-201d711a1d3dfbe46d622871731005937598e790.tar.gz
dabmod-201d711a1d3dfbe46d622871731005937598e790.tar.bz2
dabmod-201d711a1d3dfbe46d622871731005937598e790.zip
Merge branch 'next' into lime
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r--src/TimestampDecoder.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h
index ed41dfb..d083061 100644
--- a/src/TimestampDecoder.h
+++ b/src/TimestampDecoder.h
@@ -44,22 +44,9 @@ struct frame_timestamp
bool timestamp_valid = false;
bool timestamp_refresh;
- frame_timestamp& operator+=(const double& diff)
- {
- double offset_pps, offset_secs;
- offset_pps = modf(diff, &offset_secs);
-
- this->timestamp_sec += lrint(offset_secs);
- this->timestamp_pps += lrint(offset_pps * 16384000.0);
-
- while (this->timestamp_pps >= 16384000) {
- this->timestamp_pps -= 16384000;
- this->timestamp_sec += 1;
- }
- return *this;
- }
+ frame_timestamp& operator+=(const double& diff);
- const frame_timestamp operator+(const double diff) {
+ const frame_timestamp operator+(const double diff) const {
frame_timestamp ts = *this;
ts += diff;
return ts;