Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-07-08 19:59:13 +0300
committerSebastian Dröge <sebastian@centricular.com>2015-07-08 23:19:52 +0300
commit6e7c724afadd6a4d04d6e68938d314e1be570f9e (patch)
tree8ec1f5a2cd3c3627362c23e707621b02aa15ebe4
parentddd032f56b64316d5a1aa5b267ad34df4e774373 (diff)
rtpjitterbuffer: Calculate DTS from the clock if we had none for the first packet after a reset
https://bugzilla.gnome.org/show_bug.cgi?id=749536
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 9cf90f5e1..673a5ad1a 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -2586,6 +2586,28 @@ gst_rtp_jitter_buffer_chain (GstPad * pad, GstObject * parent,
}
} else {
GST_DEBUG_OBJECT (jitterbuffer, "First buffer #%d", seqnum);
+
+ /* If we have no DTS here, i.e. no capture time, get one from the
+ * clock now to have something to calculate with in the future.
+ */
+ if (dts == GST_CLOCK_TIME_NONE) {
+ GstClock *clock = gst_element_get_clock (GST_ELEMENT_CAST (jitterbuffer));
+
+ if (clock) {
+ GstClockTime base_time =
+ gst_element_get_base_time (GST_ELEMENT_CAST (jitterbuffer));
+ GstClockTime clock_time = gst_clock_get_time (clock);
+
+ if (clock_time > base_time)
+ dts = clock_time - base_time;
+ else
+ dts = 0;
+ pts = dts;
+
+ gst_object_unref (clock);
+ }
+ }
+
/* we don't know what the next_in_seqnum should be, wait for the last
* possible moment to push this buffer, maybe we get an earlier seqnum
* while we wait */