srtsrc: Defend against missing clock

If we don't have a clock, stop the source instead of asserting in
gst_clock_get_time. This can happen when the element is removed from the
pipeline while it's playing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1674>
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-10-12 14:09:28 +02:00 committed by GStreamer Merge Bot
parent 0be59181d7
commit 6b2fcb52e5

View file

@ -140,6 +140,11 @@ gst_srt_src_fill (GstPushSrc * src, GstBuffer * outbuf)
/* Get clock and values */ /* Get clock and values */
clock = gst_element_get_clock (GST_ELEMENT (src)); clock = gst_element_get_clock (GST_ELEMENT (src));
if (!clock) {
GST_DEBUG_OBJECT (src, "Clock missing, flushing");
return GST_FLOW_FLUSHING;
}
base_time = gst_element_get_base_time (GST_ELEMENT (src)); base_time = gst_element_get_base_time (GST_ELEMENT (src));
recv_len = gst_srt_object_read (self->srtobject, info.data, recv_len = gst_srt_object_read (self->srtobject, info.data,