From: <wt...@ke...> - 2007-04-05 16:10:47
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: wtay Date: Thu Apr 05 2007 16:10:36 UTC Log message: * 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. Modified files: . : ChangeLog gst/rtpmanager : gstrtpjitterbuffer.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2490&r2=1.2491 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/rtpmanager/gstrtpjitterbuffer.c.diff?r1=1.1&r2=1.2 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2490 retrieving revision 1.2491 diff -u -d -r1.2490 -r1.2491 --- ChangeLog 5 Apr 2007 15:05:23 -0000 1.2490 +++ ChangeLog 5 Apr 2007 16:10:24 -0000 1.2491 @@ -1,5 +1,13 @@ 2007-04-05 Wim Taymans <wi...@fl...> + * 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 <wi...@fl...> * gst/qtdemux/gstrtpxqtdepay.c: (gst_rtp_xqt_depay_process), (gst_rtp_xqt_depay_change_state): * gst/qtdemux/gstrtpxqtdepay.h: Index: gstrtpjitterbuffer.c RCS file: /cvs/gstreamer/gst-plugins-bad/gst/rtpmanager/gstrtpjitterbuffer.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstrtpjitterbuffer.c 3 Apr 2007 09:13:17 -0000 1.1 +++ gstrtpjitterbuffer.c 5 Apr 2007 16:10:24 -0000 1.2 @@ -336,6 +336,8 @@ /* 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 @@ 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"); priv->next_seqnum = g_value_get_uint (value); + GST_DEBUG_OBJECT (jitterbuffer, "got seqnum-base %d", priv->next_seqnum); priv->next_seqnum = -1; async_jitter_queue_set_max_queue_length (priv->queue, priv->latency_ms * priv->clock_rate / 1000); @@ -730,7 +738,6 @@ { 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 @@ 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 @@ 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); |