rtspsrc: Fix crash when is-live=false

The pad's parent (i.e., rtspsrc) can be nullptr since we add pads
later.

Co-authored-by: Jan Schmidt <jan@centricular.com>

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2751
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4965>
This commit is contained in:
Seungha Yang 2023-07-04 23:11:53 +09:00 committed by GStreamer Marge Bot
parent 33bcbad782
commit 794cde703c

View file

@ -3156,11 +3156,10 @@ gst_rtspsrc_handle_src_sink_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
GstRTSPStream *stream;
GstRTSPSrc *self = GST_RTSPSRC (GST_OBJECT_PARENT (parent));
stream = gst_pad_get_element_private (pad);
event = gst_rtspsrc_update_src_event (self, stream, event);
event = gst_rtspsrc_update_src_event (stream->parent, stream, event);
return gst_pad_push_event (stream->srcpad, event);
}