diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-04-25 08:15:58 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-11 02:30:34 +0100 |
commit | e779adca6947da83100a9af502c36d021882b117 (patch) | |
tree | e3699998bb899e8ddb883636dbf772365a018489 /gst/rtpmanager/gstrtpbin.c | |
parent | 3c5cf0cd38ac558736197d73bd2a9c0f04f7958c (diff) |
gst/rtpmanager/: Also keep track of the first buffer timestamp together with the first
Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_associate),
(gst_rtp_bin_sync_chain):
* gst/rtpmanager/rtpsession.c: (update_arrival_stats),
(rtp_session_process_sr), (rtp_session_on_timeout):
* gst/rtpmanager/rtpsource.c: (rtp_source_init),
(calculate_jitter):
* gst/rtpmanager/rtpsource.h:
* gst/rtpmanager/rtpstats.h:
Also keep track of the first buffer timestamp together with the first
RTP timestamp as they both are needed to construct the timing of
outgoing packets in the jitterbuffer and are therefore also needed to
manage lip-sync. This fixes lip-sync if the first RTP packets arrive
with a wildly different gap.
Diffstat (limited to 'gst/rtpmanager/gstrtpbin.c')
-rw-r--r-- | gst/rtpmanager/gstrtpbin.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index 76b806bc..8cfd63c4 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -306,6 +306,7 @@ struct _GstRtpBinStream /* for lip-sync */ guint64 clock_base; + guint64 clock_base_time; gint clock_rate; gint64 ts_offset; gint64 prev_ts_offset; @@ -785,6 +786,7 @@ gst_rtp_bin_associate (GstRtpBin * bin, GstRtpBinStream * stream, guint8 len, stream->local_unix = gst_util_uint64_scale_int (stream->local_rtp, GST_SECOND, stream->clock_rate); + stream->local_unix += stream->clock_base_time; /* calculate delta between server and receiver */ stream->unix_delta = stream->last_unix - stream->local_unix; @@ -942,6 +944,7 @@ gst_rtp_bin_sync_chain (GstPad * pad, GstBuffer * buffer) if (type == GST_RTCP_SDES_CNAME) { stream->clock_base = GST_BUFFER_OFFSET (buffer); + stream->clock_base_time = GST_BUFFER_OFFSET_END (buffer); /* associate the stream to CNAME */ gst_rtp_bin_associate (bin, stream, len, data); } |