diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-04-03 11:42:56 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-04-03 11:42:56 +0000 |
commit | 185dff07f5d4fdb42fa21c9c90b40b518afdfcf9 (patch) | |
tree | 2724c4cb452e709bf878436b9a45167d116671a8 /pjsip-apps | |
parent | 677baeaf767c1fc3a1aada61fa6f7ea9981d52e8 (diff) |
Changed sndinfo sample to use higher resolution pj_get_timestamp() instead of pj_gettimeofday()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@373 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/src/samples/sndinfo.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pjsip-apps/src/samples/sndinfo.c b/pjsip-apps/src/samples/sndinfo.c index 07e5df66..ea47bdc5 100644 --- a/pjsip-apps/src/samples/sndinfo.c +++ b/pjsip-apps/src/samples/sndinfo.c @@ -81,27 +81,25 @@ static char play_delays[1000]; static pj_status_t play_cb(void *user_data, pj_uint32_t timestamp, void *output, unsigned size) { - static pj_time_val last_cb; + static pj_timestamp last_cb; ++play_counter; - if (last_cb.sec == 0 && last_cb.msec == 0) { - pj_gettimeofday(&last_cb); + if (last_cb.u64 == 0) { + pj_get_timestamp(&last_cb); } else { - pj_time_val now, saved; + pj_timestamp now; int delay; - pj_gettimeofday(&now); - saved = now; - PJ_TIME_VAL_SUB(now, last_cb); - delay = PJ_TIME_VAL_MSEC(now); - + pj_get_timestamp(&now); + + delay = pj_elapsed_msec(&last_cb, &now); if (delay < min_delay) min_delay = delay; if (delay > max_delay) max_delay = delay; - last_cb = saved; + last_cb = now; play_delays[play_counter-1] = delay; } |