unref data when probe function returns FALSE. Fixes #166362

Original commit message from CVS:
unref data when probe function returns FALSE.  Fixes #166362
This commit is contained in:
Thomas Vander Stichele 2005-02-07 15:39:40 +00:00
parent 01a7744a76
commit 0080630b1a
3 changed files with 27 additions and 6 deletions

View file

@ -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> 2005-02-06 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gst.c: (gst_init_get_popt_table): * gst/gst.c: (gst_init_get_popt_table):

View file

@ -3,7 +3,7 @@ AC_CANONICAL_TARGET
dnl when going to/from release please set the nano (fourth number) right ! dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too 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 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE AM_MAINTAINER_MODE

View file

@ -3247,8 +3247,13 @@ gst_pad_push (GstPad * pad, GstData * data)
g_return_if_fail (data != NULL); g_return_if_fail (data != NULL);
DEBUG_DATA (pad, data, "gst_pad_push"); 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; return;
}
if (!GST_PAD_IS_LINKED (pad)) { if (!GST_PAD_IS_LINKED (pad)) {
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
@ -3279,13 +3284,17 @@ gst_pad_push (GstPad * pad, GstData * data)
if (peer->chainhandler) { if (peer->chainhandler) {
if (data) { 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, GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling chainhandler &%s of peer pad %s:%s", "calling chainhandler &%s of peer pad %s:%s",
GST_DEBUG_FUNCPTR_NAME (peer->chainhandler), GST_DEBUG_FUNCPTR_NAME (peer->chainhandler),
GST_DEBUG_PAD_NAME (GST_PAD (peer))); GST_DEBUG_PAD_NAME (GST_PAD (peer)));
if (!gst_probe_dispatcher_dispatch (&peer->probedisp, &data))
return;
(peer->chainhandler) (GST_PAD (peer), data); (peer->chainhandler) (GST_PAD (peer), data);
return; return;
} else { } else {
@ -3368,8 +3377,12 @@ gst_pad_pull (GstPad * pad)
} }
} }
GST_DEBUG ("calling gst_probe_dispatcher_dispatch on data %p", data); 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; goto restart;
}
DEBUG_DATA (pad, data, "gst_pad_pull returned"); DEBUG_DATA (pad, data, "gst_pad_pull returned");
return data; return data;
} }