Commit c5266cef authored by Jean-Paul Saman's avatar Jean-Paul Saman

Simplify.

parent d043e84b
...@@ -189,7 +189,7 @@ static void report_Header( int i_report ) ...@@ -189,7 +189,7 @@ static void report_Header( int i_report )
printf( "# seqno, PID PCR, network arrival (ms), PCR value (ms), PCR prev (ms), delta (ms), bytes since last pcr, bitrate (bits/delta) Kbps since last pcr\n" ); printf( "# seqno, PID PCR, network arrival (ms), PCR value (ms), PCR prev (ms), delta (ms), bytes since last pcr, bitrate (bits/delta) Kbps since last pcr\n" );
break; break;
case REPORT_UDP: case REPORT_UDP:
printf( "# seq no, previous (ms), packet arrival (ms), delta (ms), bytes since last\n"); printf( "# seq no, packet arrival (ms), delta (ms), bytes since last\n");
break; break;
} }
} }
...@@ -199,7 +199,7 @@ static void report_Header( int i_report ) ...@@ -199,7 +199,7 @@ static void report_Header( int i_report )
* PrintPacketTiming for REPORT_UDP * PrintPacketTiming for REPORT_UDP
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
static mtime_t report_UDPPacketTiming( int32_t i_seqno, mtime_t time_prev, int32_t bytes ) static mtime_t report_UDPPacketTiming( int32_t i_seqno, int32_t bytes, mtime_t time_prev, mtime_t *time_base )
#else #else
static void report_UDPPacketTiming( int32_t i_seqno, int32_t bytes ) static void report_UDPPacketTiming( int32_t i_seqno, int32_t bytes )
#endif #endif
...@@ -217,8 +217,11 @@ static void report_UDPPacketTiming( int32_t i_seqno, int32_t bytes ) ...@@ -217,8 +217,11 @@ static void report_UDPPacketTiming( int32_t i_seqno, int32_t bytes )
else else
tv_delta = (mtime_t)(time_current - time_prev); tv_delta = (mtime_t)(time_current - time_prev);
printf( "%.2d %"PRId64" %"PRId64" %"PRId64" ", if( *time_base == 0 )
i_seqno, time_prev, time_current, *time_base = time_current;
printf( "%.2d %"PRId64" %"PRId64" ",
i_seqno, time_current - *time_base,
tv_delta ); tv_delta );
time_prev = time_current; time_prev = time_current;
printf( "%d\n", bytes ); printf( "%d\n", bytes );
...@@ -533,6 +536,7 @@ int main(int i_argc, char* pa_argv[]) ...@@ -533,6 +536,7 @@ int main(int i_argc, char* pa_argv[])
#endif #endif
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
mtime_t time_prev = 0; mtime_t time_prev = 0;
mtime_t time_base = 0;
#endif #endif
mtime_t i_prev_pcr = 0; /* 33 bits */ mtime_t i_prev_pcr = 0; /* 33 bits */
int i_old_cc = -1; int i_old_cc = -1;
...@@ -650,7 +654,7 @@ int main(int i_argc, char* pa_argv[]) ...@@ -650,7 +654,7 @@ int main(int i_argc, char* pa_argv[])
if( i_report == REPORT_UDP && !b_first ) if( i_report == REPORT_UDP && !b_first )
{ {
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
time_prev = report_UDPPacketTiming( i_cc, time_prev, i_bytes ); time_prev = report_UDPPacketTiming( i_cc, i_bytes, time_prev, &time_base );
#else #else
report_UDPPacketTiming( i_cc, i_bytes ); report_UDPPacketTiming( i_cc, i_bytes );
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment