From 6b2fcb52e5b9122d46ba2ac5a41d57133b6ca111 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Mon, 12 Oct 2020 14:09:28 +0200 Subject: [PATCH] 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: --- ext/srt/gstsrtsrc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/srt/gstsrtsrc.c b/ext/srt/gstsrtsrc.c index c886e39f32..5839d7efdd 100644 --- a/ext/srt/gstsrtsrc.c +++ b/ext/srt/gstsrtsrc.c @@ -140,6 +140,11 @@ gst_srt_src_fill (GstPushSrc * src, GstBuffer * outbuf) /* Get clock and values */ 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)); recv_len = gst_srt_object_read (self->srtobject, info.data,