# include "config.h"
#endif
+#include <stdio.h>
#include <math.h>
#include "globals.h"
#include <epan/tap.h>
-#include "register.h"
#include <string.h>
#include <epan/rtp_pt.h>
#include <epan/addr_resolv.h>
size_t sourcelen;
guint16 port; /* UDP port */
guint16 padding; /* 2 padding bytes */
-
+
fprintf(file, "#!rtpplay%s %s/%u\n", RTPFILE_VERSION,
get_addr_name(&(strinfo->dest_addr)),
strinfo->dest_port);
/* increment the packets counter of all streams */
++(tapinfo->npackets);
-
+
return 1; /* refresh output */
}
else if (tapinfo->mode == TAP_SAVE) {
if (rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_fwd)==0) {
/* XXX - what if rtpinfo->info_all_data_present is
FALSE, so that we don't *have* all the data? */
- sample.header.rec_time =
+ sample.header.rec_time =
(pinfo->fd->abs_ts.nsecs/1000 + 1000000 - tapinfo->filter_stream_fwd->start_usec)/1000
+ (guint32) (pinfo->fd->abs_ts.secs - tapinfo->filter_stream_fwd->start_sec - 1)*1000;
sample.header.frame_length = rtpinfo->info_data_len;
rtp_write_sample(&sample, tapinfo->save_file);
}
}
+#ifdef __GTK_H__
else if (tapinfo->mode == TAP_MARK) {
-
if (rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_fwd)==0
|| rtp_stream_info_cmp(&tmp_strinfo, tapinfo->filter_stream_rev)==0)
{
cf_mark_frame(&cfile, pinfo->fd);
}
}
-
+#endif
return 0;
}
get_dyn_pt_clock_rate(gchar *payload_type_str)
{
int i;
-
+
/* Search for matching mimetype in reverse order to avoid false matches
* when pt_mime_name_str is the prefix of payload_type_str */
for (i = NUM_DYN_CLOCK_VALUES - 1; i > -1 ; i--) {
double expected_time;
double absskew;
guint32 clock_rate;
- guint32 old_flags;
/* Store the current time */
current_time = nstime_to_msec(&pinfo->fd->rel_ts);
statinfo->timestamp = rtpinfo->info_timestamp;
statinfo->first_timestamp = rtpinfo->info_timestamp;
statinfo->time = current_time;
+ statinfo->lastnominaltime = 0;
statinfo->pt = rtpinfo->info_payload_type;
statinfo->reg_pt = rtpinfo->info_payload_type;
statinfo->bw_history[statinfo->bw_index].bytes = rtpinfo->info_data_len + 28;
return 0;
}
- /* Save old flags and reset flags */
- old_flags = statinfo->flags;
+ /* Reset flags */
statinfo->flags = 0;
/* When calculating expected rtp packets the seq number can wrap around
clock_rate = 0;
statinfo->flags |= STAT_FLAG_PT_T_EVENT;
}else{
- clock_rate = get_dyn_pt_clock_rate(rtpinfo-> info_payload_type_str);
+ if(rtpinfo->info_payload_rate !=0){
+ clock_rate = rtpinfo->info_payload_rate;
+ }else{
+ clock_rate = get_dyn_pt_clock_rate(rtpinfo-> info_payload_type_str);
+ }
}
}else{
clock_rate = 0;
}
/* Can only analyze defined sampling rates */
- if (clock_rate != 0) {
+ if (clock_rate != 0) {
statinfo->clock_rate = clock_rate;
/* Convert from sampling clock to ms */
nominaltime = nominaltime /(clock_rate/1000);
}
/* Gather data for calculation of average, minimum and maximum framerate based on timestamp */
#if 0
- if (numPackets > 0 && (!hardPayloadType || !alternatePayloadType)) {
+ if (numPackets > 0 && (!hardPayloadType || !alternatePayloadType)) {
/* Skip first packet and possibly alternate payload type packets */
double dt;
dt = nominaltime - statinfo->lastnominaltime;
statinfo->max_delta = statinfo->delta;
statinfo->max_nr = pinfo->fd->num;
}
- if (clock_rate != 0) {
+ if (clock_rate != 0) {
/* Maximum and mean jitter calculation */
if (statinfo->jitter > statinfo->max_jitter) {
statinfo->max_jitter = statinfo->jitter;