summaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r--src/TimestampDecoder.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h
index 33d9992..6eedf9e 100644
--- a/src/TimestampDecoder.h
+++ b/src/TimestampDecoder.h
@@ -81,6 +81,12 @@ struct frame_timestamp
return ns;
}
+ void set_ns(long long int time_ns) {
+ timestamp_sec = time_ns / 1000000000ull;
+ const long long int subsecond = time_ns % 1000000000ull;
+ timestamp_pps = lrint(subsecond * 16384000.0);
+ }
+
void print(const char* t) const {
fprintf(stderr,
"%s <frame_timestamp(%s, %d, %.9f, %d)>\n",