gst-libs/gst/rtp/gstbasertpdepayload.c: Fix some memory leaks: on finalize, free buffers left in the queue before des...

Original commit message from CVS:
Patch by: Antoine Tremblay  <hexa00 at gmail dot com>
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_finalize), (gst_base_rtp_depayload_push):
Fix some memory leaks: on finalize, free buffers left in the queue
before destroying the queue; in _push(), unref rtp_buf even if
the process vfunc returned a NULL buffer as output buffer (#337548);
demote some recuring debug messages to LOG level.
This commit is contained in:
Antoine Tremblay 2006-04-11 17:31:29 +00:00 committed by Tim-Philipp Müller
parent b6582f2693
commit 5c7a047016
2 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,14 @@
2006-04-11 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Antoine Tremblay <hexa00 at gmail dot com>
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_finalize), (gst_base_rtp_depayload_push):
Fix some memory leaks: on finalize, free buffers left in the queue
before destroying the queue; in _push(), unref rtp_buf even if
the process vfunc returned a NULL buffer as output buffer (#337548);
demote some recuring debug messages to LOG level.
2006-04-11 Wim Taymans <wim@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_src_query),

View file

@ -164,6 +164,10 @@ gst_base_rtp_depayload_init (GstBaseRTPDepayload * filter, gpointer g_class)
static void
gst_base_rtp_depayload_finalize (GObject * object)
{
GstBuffer *buf;
while ((buf = g_queue_pop_head (GST_BASE_RTP_DEPAYLOAD (object)->queue)))
gst_buffer_unref (buf);
g_queue_free (GST_BASE_RTP_DEPAYLOAD (object)->queue);
if (G_OBJECT_CLASS (parent_class)->finalize)
@ -321,12 +325,12 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * rtp_buf)
bclass->set_gst_timestamp (filter, gst_rtp_buffer_get_timestamp (rtp_buf),
out_buf);
/* push it */
GST_DEBUG_OBJECT (filter, "Pushing buffer size %d, timestamp %u",
GST_LOG_OBJECT (filter, "Pushing buffer size %d, timestamp %u",
GST_BUFFER_SIZE (out_buf), GST_BUFFER_TIMESTAMP (out_buf));
gst_pad_push (filter->srcpad, GST_BUFFER (out_buf));
gst_buffer_unref (rtp_buf);
GST_DEBUG_OBJECT (filter, "Pushed buffer");
GST_LOG_OBJECT (filter, "Pushed buffer");
}
gst_buffer_unref (rtp_buf);
}
static void