aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-12-02 08:38:59 +0000
committerGuy Harris <guy@alum.mit.edu>2004-12-02 08:38:59 +0000
commitf516cf141fee24a98bfed082c438d07585c4f478 (patch)
treee299edb22cb9ec18c1adc697061578a8488e6d0d
parent4437245d3037889be16304f91e079937fec62a4f (diff)
From Francisco Alcoba: handle inverted time stamps without hanging.
svn path=/trunk/; revision=12656
-rw-r--r--gtk/rtp_analysis.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c
index eaa9e98d4d..bce23cd2c4 100644
--- a/gtk/rtp_analysis.c
+++ b/gtk/rtp_analysis.c
@@ -299,6 +299,7 @@ typedef struct _tap_rtp_stat_t {
#define STAT_FLAG_PT_CN 0x10
#define STAT_FLAG_FOLLOW_PT_CN 0x20
#define STAT_FLAG_REG_PT_CHANGE 0x40
+#define STAT_FLAG_WRONG_TIMESTAMP 0x80
typedef struct _tap_rtp_save_info_t {
FILE *fp;
@@ -652,13 +653,19 @@ static int rtp_packet_analyse(tap_rtp_stat_t *statinfo,
}
/* is it a packet with the mark bit set? */
if (rtpinfo->info_marker_set) {
- statinfo->delta_timestamp = rtpinfo->info_timestamp - statinfo->timestamp;
- statinfo->flags |= STAT_FLAG_MARKER;
+ if (rtpinfo->info_timestamp > statinfo->timestamp){
+ statinfo->delta_timestamp = rtpinfo->info_timestamp - statinfo->timestamp;
+ statinfo->flags |= STAT_FLAG_MARKER;
+ }
+ else{
+ statinfo->flags |= STAT_FLAG_WRONG_TIMESTAMP;
+ }
}
/* is it a regular packet? */
if (!(statinfo->flags & STAT_FLAG_FIRST)
&& !(statinfo->flags & STAT_FLAG_MARKER)
&& !(statinfo->flags & STAT_FLAG_PT_CN)
+ && !(statinfo->flags & STAT_FLAG_WRONG_TIMESTAMP)
&& !(statinfo->flags & STAT_FLAG_FOLLOW_PT_CN)) {
/* include it in maximum delta calculation */
if (statinfo->delta > statinfo->max_delta) {
@@ -788,6 +795,10 @@ static int rtp_packet_add_info(GtkCList *clist,
g_snprintf(status,sizeof(status),"Payload changed to PT=%u", statinfo->pt);
color = COLOR_WARNING;
}
+ else if (statinfo->flags & STAT_FLAG_WRONG_TIMESTAMP) {
+ g_snprintf(status,sizeof(status),"Incorrect timestamp");
+ color = COLOR_WARNING;
+ }
else if ((statinfo->flags & STAT_FLAG_PT_CHANGE)
&& !(statinfo->flags & STAT_FLAG_FIRST)
&& !(statinfo->flags & STAT_FLAG_PT_CN)