mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +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
0324358ebc
commit
d04c8b6d2e
1 changed files with 5 additions and 0 deletions
|
@ -1288,6 +1288,9 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
|
|||
GstPadProbeInfo info = { GST_PAD_PROBE_TYPE_IDLE, res, };
|
||||
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 */
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
|
||||
"pad is idle, trigger idle callback");
|
||||
|
@ -1317,6 +1320,8 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask,
|
|||
break;
|
||||
}
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
gst_object_unref (pad);
|
||||
}
|
||||
} else {
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
|
Loading…
Reference in a new issue