diff options
author | Jan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com> | 2020-10-12 14:09:28 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-10-12 23:50:12 +0100 |
commit | 41a818dff545ed55fb45a4fcc04f69713525a6b2 (patch) | |
tree | 8a59de99f95f7857be73d1254d08595bdfed242f | |
parent | 0940339fcd4b85fd6361e5fb8e20b48a0fedfd26 (diff) | |
download | gstreamer-plugins-bad-41a818dff545ed55fb45a4fcc04f69713525a6b2.tar.gz |
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/1690>
-rw-r--r-- | ext/srt/gstsrtsrc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/srt/gstsrtsrc.c b/ext/srt/gstsrtsrc.c index c886e39f3..5839d7efd 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, |