summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--gst/rtpmanager/gstrtpjitterbuffer.c21
2 files changed, 23 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 36297081..2992c20d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2007-04-05 Wim Taymans <wim@fluendo.com>
+ * gst/rtpmanager/gstrtpjitterbuffer.c:
+ (gst_jitter_buffer_sink_setcaps), (gst_rtp_jitter_buffer_chain),
+ (gst_rtp_jitter_buffer_loop):
+ Add some debug and comments.
+ Fix double unref() in error cases.
+
+2007-04-05 Wim Taymans <wim@fluendo.com>
+
* gst/qtdemux/gstrtpxqtdepay.c: (gst_rtp_xqt_depay_process),
(gst_rtp_xqt_depay_change_state):
* gst/qtdemux/gstrtpxqtdepay.h:
diff --git a/gst/rtpmanager/gstrtpjitterbuffer.c b/gst/rtpmanager/gstrtpjitterbuffer.c
index 58b48a34..21fecf8f 100644
--- a/gst/rtpmanager/gstrtpjitterbuffer.c
+++ b/gst/rtpmanager/gstrtpjitterbuffer.c
@@ -336,6 +336,8 @@ gst_jitter_buffer_sink_setcaps (GstPad * pad, GstCaps * caps)
/* first parse the caps */
caps_struct = gst_caps_get_structure (caps, 0);
+ GST_DEBUG_OBJECT (jitterbuffer, "got caps");
+
/* we need a clock-rate to convert the rtp timestamps to GStreamer time and to
* measure the amount of data in the buffer */
if (!gst_structure_get_int (caps_struct, "clock-rate", &priv->clock_rate))
@@ -344,22 +346,28 @@ gst_jitter_buffer_sink_setcaps (GstPad * pad, GstCaps * caps)
if (priv->clock_rate <= 0)
goto wrong_rate;
+ GST_DEBUG_OBJECT (jitterbuffer, "got clock-rate %d", priv->clock_rate);
+
/* gah, clock-base is uint. If we don't have a base, we will use the first
* buffer timestamp as the base time. This will screw up sync but it's better
* than nothing. */
value = gst_structure_get_value (caps_struct, "clock-base");
- if (value && G_VALUE_HOLDS_UINT (value))
+ if (value && G_VALUE_HOLDS_UINT (value)) {
priv->clock_base = g_value_get_uint (value);
- else
+ GST_DEBUG_OBJECT (jitterbuffer, "got clock-base %d", priv->clock_base);
+ } else
priv->clock_base = -1;
/* first expected seqnum */
value = gst_structure_get_value (caps_struct, "seqnum-base");
- if (value && G_VALUE_HOLDS_UINT (value))
+ if (value && G_VALUE_HOLDS_UINT (value)) {
priv->next_seqnum = g_value_get_uint (value);
- else
+ GST_DEBUG_OBJECT (jitterbuffer, "got seqnum-base %d", priv->next_seqnum);
+ } else
priv->next_seqnum = -1;
+
+
async_jitter_queue_set_max_queue_length (priv->queue,
priv->latency_ms * priv->clock_rate / 1000);
@@ -730,7 +738,6 @@ out_flushing:
{
GST_DEBUG_OBJECT (jitterbuffer, "flushing %s", gst_flow_get_name (ret));
gst_buffer_unref (buffer);
- gst_object_unref (jitterbuffer);
goto finished;
}
too_late:
@@ -774,6 +781,8 @@ gst_rtp_jitter_buffer_loop (GstRTPJitterBuffer * jitterbuffer)
async_jitter_queue_lock (priv->queue);
again:
+ GST_DEBUG_OBJECT (jitterbuffer, "Popping item");
+ /* pop a buffer, we will get NULL if the queue was shut down */
elem = async_jitter_queue_pop_unlocked (priv->queue);
if (!elem)
goto no_elem;
@@ -800,7 +809,7 @@ again:
return;
}
- /* pop a buffer, we will get NULL if the queue was shut down */
+ /* we know it's a buffer now */
outbuf = GST_BUFFER_CAST (elem);
seqnum = gst_rtp_buffer_get_seq (outbuf);