diff options
author | Data Path <data2path@gmail.com> | 2015-05-14 15:50:08 +0200 |
---|---|---|
committer | Data Path <data2path@gmail.com> | 2015-05-14 15:50:08 +0200 |
commit | d5a0f2512f129135cd9dd21a8db7fd00e35e89a6 (patch) | |
tree | 173499ecb31b7fcc2afd1336ef48b67e697bcb49 | |
parent | b030ce5512305b9b0a39cb97d25d33d16f2ebf70 (diff) | |
download | etisnoop-d5a0f2512f129135cd9dd21a8db7fd00e35e89a6.tar.gz etisnoop-d5a0f2512f129135cd9dd21a8db7fd00e35e89a6.tar.bz2 etisnoop-d5a0f2512f129135cd9dd21a8db7fd00e35e89a6.zip |
Add timestamp and frame number
-rw-r--r-- | etisnoop.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/etisnoop.cpp b/etisnoop.cpp index 910a73f..11980d1 100644 --- a/etisnoop.cpp +++ b/etisnoop.cpp @@ -359,6 +359,7 @@ int eti_analyse(eti_analyse_config_t& config) unsigned char scid,tpl,l1; unsigned short int sad[64],stl[64]; char sdesc[256]; + unsigned int frame_nb = 0, frame_sec = 0, frame_ms = 0, frame_h, frame_m, frame_s; bool running = true; @@ -394,6 +395,19 @@ int eti_analyse(eti_analyse_config_t& config) break; } + // Timestamp and Frame Number + frame_h = (frame_sec / 3600); + frame_m = (frame_sec - (frame_h * 3600)) / 60; + frame_s = (frame_sec - (frame_h * 3600) - (frame_m * 60)); + sprintf(sdesc, "%02d:%02d:%02d.%03d frame %d", frame_h, frame_m, frame_s, frame_ms, frame_nb); + printbuf(sdesc, 0, NULL, 0); + frame_ms += 24; // + 24 ms + if (frame_ms >= 1000) { + frame_ms -= 1000; + frame_sec++; + } + frame_nb++; + // SYNC printbuf("SYNC", 0, p, 4); |