@@ -46,12 +46,11 @@ namespace gr {
4646 gr::io_signature::make (1 , 1 , sizeof (uint8_t )),
4747 gr::io_signature::make(1 , 1 , sizeof (gr_complex)))
4848 {
49- struct timespec ts_now;
5049 d_sample_rate = sample_rate;
5150 d_sample_count = 0 ;
5251 d_current_symbol = 0 ;
53- clock_gettime (CLOCK_MONOTONIC, &ts_now) ;
54- d_timestamp = ( int64_t ) ts_now. tv_sec * 1000000000 + ts_now. tv_nsec ;
52+ d_timestamp = 0 ;
53+ d_first_call = true ;
5554
5655 // Build the table of modulated symbol samples.
5756 d_symbol_length = sample_rate / baud_rate;
@@ -83,6 +82,7 @@ namespace gr {
8382 gr_vector_const_void_star &input_items,
8483 gr_vector_void_star &output_items)
8584 {
85+ struct timespec ts_now;
8686 const uint8_t *in = (const uint8_t *) input_items[0 ];
8787 gr_complex *out = (gr_complex *) output_items[0 ];
8888 int in_i = 0 ;
@@ -91,8 +91,12 @@ namespace gr {
9191 // Perform basic output rate limiting to prevent transmit buffer
9292 // bloat. This approach should be replaced by proper output buffer
9393 // latency management when possible. Stalls on idle cycles only.
94+ if (d_first_call) {
95+ d_first_call = false ;
96+ clock_gettime (CLOCK_MONOTONIC, &ts_now);
97+ d_timestamp = (int64_t ) ts_now.tv_sec * 1000000000 + ts_now.tv_nsec ;
98+ }
9499 if (in[0 ] == 0xFF ) {
95- struct timespec ts_now;
96100 int64_t now;
97101 clock_gettime (CLOCK_MONOTONIC, &ts_now);
98102 now = (int64_t ) ts_now.tv_sec * 1000000000 + ts_now.tv_nsec ;
0 commit comments