Changeset 1865

Show
Ignore:
Timestamp:
08/24/98 11:15:06 (16 years ago)
Author:
ucacoxh
Message:

- Fixed div by zero error when calculating the jitter.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • rat/trunk/statistics.c

    r1852 r1865  
    198198                } 
    199199        } else { 
    200                 diff       = abs(delay - src->delay) / abs(hdr->seq - src->last_seq); 
     200                if (hdr->seq != src->last_seq) { 
     201                        diff       = abs(delay - src->delay) / abs(hdr->seq - src->last_seq); 
     202                } else { /* Duplicate */ 
     203                        diff       = abs(delay - src->delay); 
     204                } 
    201205                /* Jitter calculation as in RTP spec */ 
    202206                src->jitter += (((double) diff - src->jitter) / 16.0);