mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
pad: Keep an extra ref of the pad when calling an IDLE probe immediately
The callback might destroy the pad.
This commit is contained in:
parent
fac8b48c27
commit
0716b35219
1 changed files with 5 additions and 0 deletions
|
@ -1285,6 +1285,9 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
|
||||||
GstPadProbeInfo info = { GST_PAD_PROBE_TYPE_IDLE, res, };
|
GstPadProbeInfo info = { GST_PAD_PROBE_TYPE_IDLE, res, };
|
||||||
GstPadProbeReturn ret;
|
GstPadProbeReturn ret;
|
||||||
|
|
||||||
|
/* Keep another ref, the callback could destroy the pad */
|
||||||
|
gst_object_ref (pad);
|
||||||
|
|
||||||
/* the pad is idle now, we can signal the idle callback now */
|
/* the pad is idle now, we can signal the idle callback now */
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||||
"pad is idle, trigger idle callback");
|
"pad is idle, trigger idle callback");
|
||||||
|
@ -1314,6 +1317,8 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
|
gst_object_unref (pad);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
Loading…
Reference in a new issue