GNOME Bugzilla – Bug 787243
pad: probe returning HANDLED does not behave in the expected way
Last modified: 2017-09-05 08:52:36 UTC
Created attachment 359065 [details] [review] pad: add test to check handled and drop probes Hello, I have come across that probes returning HANDLED do not behave as the current doc says: @GST_PAD_PROBE_HANDLED: Data has been handled in the probe and will not be forwarded further. For events and buffers this is the same behaviour as %GST_PAD_PROBE_DROP (except that in this case you need to unref the buffer or event yourself). For queries it will also return %TRUE to the caller. The probe can also modify the #GstFlowReturn value by using the #GST_PAD_PROBE_INFO_FLOW_RETURN() accessor. Note that the resulting query must contain valid entries. Since: 1.6 The point is that if there is another probe in the same pad it is called after the probe returning HANDLED (when not expected) and if this other probe returns DROP we deal with a GstBuffer refcount problem. In order to show this issue I have created a test where you can see: GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed
Created attachment 359072 [details] [review] pad: Don't call remaining probes after they return DROPPED|HANDLED If multiple probes are set on a pad and one probe returns either GST_PAD_PROBE_HANDLED or GST_PAD_PROBE_DROPPED we need to stop calling the remaining probes.
Review of attachment 359072 [details] [review]: Make sense to me.
commit 1b469fbcd07aec39683055e1c48c0e2b59a3da61 (HEAD -> master, origin/master, origin/HEAD) Author: Miguel París <mparisdiaz@gmail.com> Date: Mon Sep 4 12:20:43 2017 +0200 pad: add test to check handled and drop probes https://bugzilla.gnome.org/show_bug.cgi?id=787243 commit aed32ee2abf866f905b710102ef1a3f2dcd4e502 Author: Edward Hervey <edward@centricular.com> Date: Mon Sep 4 14:33:29 2017 +0200 pad: Don't call remaining probes after they return DROPPED|HANDLED If multiple probes are set on a pad and one probe returns either GST_PAD_PROBE_HANDLED or GST_PAD_PROBE_DROPPED we need to stop calling the remaining probes. https://bugzilla.gnome.org/show_bug.cgi?id=787243
Thanks everybody for handling this so fast ;).