ext/ladspa/gstsignalprocessor.c: A push() gives away our refcount so we should not use the buffer on the pen anymore.

Original commit message from CVS:
* ext/ladspa/gstsignalprocessor.c: (gst_signal_processor_flush),
(gst_signal_processor_do_pushes):
A push() gives away our refcount so we should not use the buffer on the
pen anymore.
This commit is contained in:
Wim Taymans 2006-08-16 14:47:50 +00:00
parent f349fb3810
commit f12aed235d

View file

@ -602,8 +602,6 @@ gst_signal_processor_flush (GstSignalProcessor * self)
{ {
GList *pads; GList *pads;
pads = GST_ELEMENT (self)->pads;
for (pads = GST_ELEMENT (self)->pads; pads; pads = pads->next) { for (pads = GST_ELEMENT (self)->pads; pads; pads = pads->next) {
GstSignalProcessorPad *spad = (GstSignalProcessorPad *) pads->data; GstSignalProcessorPad *spad = (GstSignalProcessorPad *) pads->data;
@ -708,6 +706,7 @@ gst_signal_processor_do_pushes (GstSignalProcessor * self)
for (; srcpads; srcpads = srcpads->next) { for (; srcpads; srcpads = srcpads->next) {
GstSignalProcessorPad *spad = (GstSignalProcessorPad *) srcpads->data; GstSignalProcessorPad *spad = (GstSignalProcessorPad *) srcpads->data;
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GstBuffer *buffer;
if (!spad->pen) { if (!spad->pen) {
g_warning ("Unexpectedly empty buffer pen for pad %s:%s", g_warning ("Unexpectedly empty buffer pen for pad %s:%s",
@ -715,14 +714,17 @@ gst_signal_processor_do_pushes (GstSignalProcessor * self)
continue; continue;
} }
ret = gst_pad_push (GST_PAD (spad), spad->pen); /* take buffer from pen */
buffer = spad->pen;
spad->pen = NULL;
ret = gst_pad_push (GST_PAD (spad), buffer);
if (ret != GST_FLOW_OK) { if (ret != GST_FLOW_OK) {
self->flow_state = ret; self->flow_state = ret;
gst_signal_processor_flush (self); gst_signal_processor_flush (self);
return; return;
} else { } else {
spad->pen = NULL;
g_assert (self->pending_out > 0); g_assert (self->pending_out > 0);
self->pending_out--; self->pending_out--;
} }