rtpsource: use running_time for jitter

Use the running_time to calculate the jitter instead of the ntp time. Part of
the plan to get rid of ntpnsbase.
This commit is contained in:
Wim Taymans 2010-01-20 18:19:34 +01:00 committed by Wim Taymans
parent 83cb1aecc8
commit 74241e549f

View file

@ -807,14 +807,14 @@ static void
calculate_jitter (RTPSource * src, GstBuffer * buffer, calculate_jitter (RTPSource * src, GstBuffer * buffer,
RTPArrivalStats * arrival) RTPArrivalStats * arrival)
{ {
guint64 ntpnstime; GstClockTime running_time;
guint32 rtparrival, transit, rtptime; guint32 rtparrival, transit, rtptime;
gint32 diff; gint32 diff;
gint clock_rate; gint clock_rate;
guint8 pt; guint8 pt;
/* get arrival time */ /* get arrival time */
if ((ntpnstime = arrival->ntpnstime) == GST_CLOCK_TIME_NONE) if ((running_time = arrival->running_time) == GST_CLOCK_TIME_NONE)
goto no_time; goto no_time;
pt = gst_rtp_buffer_get_payload_type (buffer); pt = gst_rtp_buffer_get_payload_type (buffer);
@ -829,7 +829,7 @@ calculate_jitter (RTPSource * src, GstBuffer * buffer,
/* convert arrival time to RTP timestamp units, truncate to 32 bits, we don't /* convert arrival time to RTP timestamp units, truncate to 32 bits, we don't
* care about the absolute value, just the difference. */ * care about the absolute value, just the difference. */
rtparrival = gst_util_uint64_scale_int (ntpnstime, clock_rate, GST_SECOND); rtparrival = gst_util_uint64_scale_int (running_time, clock_rate, GST_SECOND);
/* transit time is difference with RTP timestamp */ /* transit time is difference with RTP timestamp */
transit = rtparrival - rtptime; transit = rtparrival - rtptime;
@ -859,7 +859,7 @@ calculate_jitter (RTPSource * src, GstBuffer * buffer,
/* ERRORS */ /* ERRORS */
no_time: no_time:
{ {
GST_WARNING ("cannot get current time"); GST_WARNING ("cannot get current running_time");
return; return;
} }
no_clock_rate: no_clock_rate: