tap-rtp-common.c: set STAT_FLAG_WRONG_TIMESTAMP when timestamp sequence is wrong

Set STAT_FLAG_WRONG_TIMESTAMP for RTP sequence when newer packet has lower timestamp than previous one.

Change-Id: Ib18830eea33ddb3dbbdf3beba279131c0fc5a948
Reviewed-on: https://code.wireshark.org/review/19292
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2016-12-13 11:39:16 +01:00 committed by Anders Broman
parent 0e6333cfb4
commit 3a6c5f0717
1 changed files with 10 additions and 7 deletions

View File

@ -663,15 +663,18 @@ rtp_packet_analyse(tap_rtp_stat_t *statinfo,
if (statinfo->bw_index == BUFF_BW) statinfo->bw_index = 0;
/* Used by GTK code only */
statinfo->delta_timestamp = guint32_wraparound_diff(rtpinfo->info_timestamp, statinfo->timestamp);
/* Is it a packet with the mark bit set? */
if (rtpinfo->info_marker_set) {
statinfo->delta_timestamp = guint32_wraparound_diff(rtpinfo->info_timestamp, statinfo->timestamp);
if (rtpinfo->info_timestamp > statinfo->timestamp){
statinfo->flags |= STAT_FLAG_MARKER;
}
else{
statinfo->flags |= STAT_FLAG_WRONG_TIMESTAMP;
}
statinfo->flags |= STAT_FLAG_MARKER;
}
/* Difference can be negative. We don't expect difference bigger than 31 bits. Difference don't care about wrap around. */
gint32 tsdelta=rtpinfo->info_timestamp - statinfo->timestamp;
if (tsdelta < 0) {
statinfo->flags |= STAT_FLAG_WRONG_TIMESTAMP;
}
/* Is it a regular packet? */
if (!(statinfo->flags & STAT_FLAG_FIRST)