aboutsummaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/TimestampDecoder.h')
-rw-r--r--src/TimestampDecoder.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h
index e0dee2a..34d862f 100644
--- a/src/TimestampDecoder.h
+++ b/src/TimestampDecoder.h
@@ -43,7 +43,7 @@ struct frame_timestamp
uint32_t timestamp_sec;
uint32_t timestamp_pps; // In units of 1/16384000 s
- bool timestamp_valid;
+ bool timestamp_valid = false;
bool timestamp_refresh;
frame_timestamp() = default;
@@ -88,6 +88,12 @@ struct frame_timestamp
return timestamp_pps / 16384000.0;
}
+ double get_real_secs() const {
+ double t = timestamp_sec;
+ t += timestamp_pps;
+ return t;
+ }
+
void print(const char* t)
{
fprintf(stderr,