summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/gstrtpjitterbuffer.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-09-15 18:48:03 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-09-15 18:48:03 +0000
commit6494828ef2e9aefb41822cf476afe4b306ceb42a (patch)
tree15f086dc4e98736591f826d218654c2566bcb814 /gst/rtpmanager/gstrtpjitterbuffer.c
parentf6b7f47cf430393041bd4262ddac2bb51a3a8a1d (diff)
downloadgst-plugins-bad-6494828ef2e9aefb41822cf476afe4b306ceb42a.tar.gz
gst-plugins-bad-6494828ef2e9aefb41822cf476afe4b306ceb42a.tar.bz2
gst-plugins-bad-6494828ef2e9aefb41822cf476afe4b306ceb42a.zip
gst/rtpmanager/gstrtpbin.c: Also set NTP base time on new sessions.
Original commit message from CVS: * gst/rtpmanager/gstrtpbin.c: (create_session): Also set NTP base time on new sessions. * gst/rtpmanager/gstrtpjitterbuffer.c: (gst_rtp_jitter_buffer_loop), (gst_rtp_jitter_buffer_query), (gst_rtp_jitter_buffer_set_property), (gst_rtp_jitter_buffer_get_property): Use the right lock to protect our variables. Fix some comment. * gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_getcaps_send_rtp), (gst_rtp_session_chain_send_rtp), (create_send_rtp_sink): Implement getcaps on the sender sinkpad so that payloaders can negotiate the right SSRC.
Diffstat (limited to 'gst/rtpmanager/gstrtpjitterbuffer.c')
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 497ce89d..327ff0a3 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -1018,7 +1018,8 @@ again:
priv->clock_base = exttimestamp;
}
- /* take rtp timestamp offset into account, this can wrap around */
+ /* take rtp timestamp offset into account, this should not wrap around since
+ * we are dealing with the extended timestamp here. */
exttimestamp -= priv->clock_base;
/* bring timestamp to gst time */
@@ -1218,9 +1219,8 @@ gst_rtp_jitter_buffer_query (GstPad * pad, GstQuery * query)
/* store this so that we can safely sync on the peer buffers. */
JBUF_LOCK (priv);
priv->peer_latency = min_latency;
- JBUF_UNLOCK (priv);
-
our_latency = ((guint64) priv->latency_ms) * GST_MSECOND;
+ JBUF_UNLOCK (priv);
GST_DEBUG_OBJECT (jitterbuffer, "Our latency: %" GST_TIME_FORMAT,
GST_TIME_ARGS (our_latency));
@@ -1263,11 +1263,12 @@ gst_rtp_jitter_buffer_set_property (GObject * object,
{
guint new_latency, old_latency;
- /* FIXME, not threadsafe */
new_latency = g_value_get_uint (value);
- old_latency = priv->latency_ms;
+ JBUF_LOCK (priv);
+ old_latency = priv->latency_ms;
priv->latency_ms = new_latency;
+ JBUF_UNLOCK (priv);
/* post message if latency changed, this will inform the parent pipeline
* that a latency reconfiguration is possible/needed. */
@@ -1306,7 +1307,9 @@ gst_rtp_jitter_buffer_get_property (GObject * object,
switch (prop_id) {
case PROP_LATENCY:
+ JBUF_LOCK (priv);
g_value_set_uint (value, priv->latency_ms);
+ JBUF_UNLOCK (priv);
break;
case PROP_DROP_ON_LATENCY:
g_value_set_boolean (value, priv->drop_on_latency);