Changeset 373


Ignore:
Timestamp:
Apr 3, 2006 11:42:56 AM (18 years ago)
Author:
bennylp
Message:

Changed sndinfo sample to use higher resolution pj_get_timestamp() instead of pj_gettimeofday()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/sndinfo.c

    r371 r373  
    8282                           void *output, unsigned size) 
    8383{ 
    84     static pj_time_val last_cb; 
     84    static pj_timestamp last_cb; 
    8585 
    8686    ++play_counter; 
    8787 
    88     if (last_cb.sec == 0 && last_cb.msec == 0) { 
    89         pj_gettimeofday(&last_cb); 
     88    if (last_cb.u64 == 0) { 
     89        pj_get_timestamp(&last_cb); 
    9090    } else { 
    91         pj_time_val now, saved; 
     91        pj_timestamp now; 
    9292        int delay; 
    9393 
    94         pj_gettimeofday(&now); 
    95         saved = now; 
    96         PJ_TIME_VAL_SUB(now, last_cb); 
    97         delay = PJ_TIME_VAL_MSEC(now); 
    98  
     94        pj_get_timestamp(&now); 
     95         
     96        delay = pj_elapsed_msec(&last_cb, &now); 
    9997        if (delay < min_delay) 
    10098            min_delay = delay; 
     
    102100            max_delay = delay; 
    103101 
    104         last_cb = saved; 
     102        last_cb = now; 
    105103 
    106104        play_delays[play_counter-1] = delay; 
Note: See TracChangeset for help on using the changeset viewer.