unref data when probe function returns FALSE. Fixes #166362
Original commit message from CVS:
unref data when probe function returns FALSE. Fixes #166362
diff --git a/ChangeLog b/ChangeLog
index a1faf98..11d6ae4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-02-07 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ patch by: Tim Philipp-Müller
+
+ * configure.ac:
+ * gst/gstpad.c:
+ unref data when probe function returns FALSE. Fixes #166362
+
2005-02-06 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gst.c: (gst_init_get_popt_table):
diff --git a/configure.ac b/configure.ac
index 4ada7b3..c558abc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
-AS_VERSION(gstreamer, GST_VERSION, 0, 8, 8, 1, GST_CVS="no", GST_CVS="yes")
+AS_VERSION(gstreamer, GST_VERSION, 0, 8, 8, 2, GST_CVS="no", GST_CVS="yes")
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 006f62b..c7ce568 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -3247,8 +3247,13 @@
g_return_if_fail (data != NULL);
DEBUG_DATA (pad, data, "gst_pad_push");
- if (!gst_probe_dispatcher_dispatch (&(GST_REAL_PAD (pad)->probedisp), &data))
+
+ if (!gst_probe_dispatcher_dispatch (&(GST_REAL_PAD (pad)->probedisp), &data)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
+ "not pushing data %p, blocked by probe", data);
+ gst_data_unref (data);
return;
+ }
if (!GST_PAD_IS_LINKED (pad)) {
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
@@ -3279,13 +3284,17 @@
if (peer->chainhandler) {
if (data) {
+ if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
+ "not pushing data %p, blocked by probe", data);
+ gst_data_unref (data);
+ return;
+ }
+
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling chainhandler &%s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->chainhandler),
GST_DEBUG_PAD_NAME (GST_PAD (peer)));
- if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
- return;
-
(peer->chainhandler) (GST_PAD (peer), data);
return;
} else {
@@ -3368,8 +3377,12 @@
}
}
GST_DEBUG ("calling gst_probe_dispatcher_dispatch on data %p", data);
- if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
+ if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
+ "not returning pulled data %p, blocked by probe", data);
+ gst_data_unref (data);
goto restart;
+ }
DEBUG_DATA (pad, data, "gst_pad_pull returned");
return data;
}