summaryrefslogtreecommitdiffstats
path: root/src/TimestampDecoder.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-11-02 14:11:26 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-11-02 14:11:26 +0100
commit450c1e1d29a08326f4a370005bacafd528cd25e7 (patch)
treed9c21863bf6c1c0e2024203a5e1f1731f7e36f18 /src/TimestampDecoder.h
parent1c5372335338962ccbe9e876467b7e0ea46877ac (diff)
downloaddabmod-450c1e1d29a08326f4a370005bacafd528cd25e7.tar.gz
dabmod-450c1e1d29a08326f4a370005bacafd528cd25e7.tar.bz2
dabmod-450c1e1d29a08326f4a370005bacafd528cd25e7.zip
Create new SDR output abstraction and port Soapy
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,