From d74d5995e2b0dca06c8a29a3a6f97b79e03a6d3d Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Tue, 3 Jan 2006 16:24:56 +0000 Subject: From Martin Mathieson I keep finding finding traces that show new problems with this code. This patch fixes 2 problems: - I've seen RTCP frames containing a SR and RR with identical source info and the lsr matching the current MSW/LSW timestamp of the SR. Don't want to do calculation without real roundtrip info - calculating the gap between the 2 frames was still wrong (sigh) svn path=/trunk/; revision=16934 --- epan/dissectors/packet-rtcp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-rtcp.c') diff --git a/epan/dissectors/packet-rtcp.c b/epan/dissectors/packet-rtcp.c index a27c6e1efa..087e59fd32 100644 --- a/epan/dissectors/packet-rtcp.c +++ b/epan/dissectors/packet-rtcp.c @@ -1713,6 +1713,12 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo, p_add_proto_data(pinfo->fd, proto_rtcp, p_packet_data); } + /* Don't allow match seemingly calculated from same frame! */ + if (pinfo->fd->num == p_conv_data->last_received_frame_number) + { + return; + } + /* Any previous report must match the lsr given here */ if (p_conv_data->last_received_ts == lsr) { @@ -1722,9 +1728,8 @@ static void calculate_roundtrip_delay(tvbuff_t *tvb, packet_info *pinfo, gint nseconds_between_packets = pinfo->fd->abs_ts.nsecs - p_conv_data->last_received_timestamp.nsecs; - - gint total_gap = ((seconds_between_packets*1000) + - nseconds_between_packets) / 1000000; + gint total_gap = (seconds_between_packets*1000) + + (nseconds_between_packets / 1000000); gint delay = total_gap - (int)(((double)dlsr/(double)65536) * 1000.0); /* No useful calculation can be done if dlsr not set... */ -- cgit v1.2.3