From 8b5833c54661bb77c39dcdca3dbfbf673f03ffcb Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sat, 5 Aug 2023 01:39:29 +1000 Subject: [PATCH] audiolatency: Fix event refcounting bug handling latency events Fix a refcounting bug introduced in https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5146 If upstream returns FALSE when processing a latency event, it will be unreffed an extra time Part-of: --- .../gst-plugins-bad/gst/audiolatency/gstaudiolatency.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst/audiolatency/gstaudiolatency.c b/subprojects/gst-plugins-bad/gst/audiolatency/gstaudiolatency.c index 41b482e851..5a448ef33e 100644 --- a/subprojects/gst-plugins-bad/gst/audiolatency/gstaudiolatency.c +++ b/subprojects/gst-plugins-bad/gst/audiolatency/gstaudiolatency.c @@ -455,7 +455,12 @@ gst_audiolatency_src_probe (GstPad * pad, GstPadProbeInfo * info, GST_LOG_OBJECT (self, "Forwarded latency event to sinkpad. Result %d %" GST_PTR_FORMAT, res, event); - return res ? GST_PAD_PROBE_HANDLED : GST_PAD_PROBE_DROP; + if (!res) { + /* This doesn't actually do anything - pad probe handling ignores + * it, but maybe one day */ + GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_ERROR; + } + return GST_PAD_PROBE_HANDLED; } }