diff options
author | Arnaud Vrac <avrac@freebox.fr> | 2024-03-26 14:28:28 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2024-03-28 10:34:52 +0000 |
commit | 801a6e5faa2aff97a186d9c63a11c8f34f01879c (patch) | |
tree | 0b909e59295401de4c355f1d7face26ec9e1938e /subprojects | |
parent | b014650cbefbf70d0e8b9766010455f61feffbd4 (diff) |
inputselector: fix possible clock leak on shutdown
Avoid leaking a GstClock object on shutdown, bail out before taking the ref when
not playing.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6458>
Diffstat (limited to 'subprojects')
-rw-r--r-- | subprojects/gstreamer/plugins/elements/gstinputselector.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/subprojects/gstreamer/plugins/elements/gstinputselector.c b/subprojects/gstreamer/plugins/elements/gstinputselector.c index b025c70682..c5d739b061 100644 --- a/subprojects/gstreamer/plugins/elements/gstinputselector.c +++ b/subprojects/gstreamer/plugins/elements/gstinputselector.c @@ -839,6 +839,13 @@ gst_input_selector_wait_running_time (GstInputSelector * sel, GstClockTimeDiff jitter; GstClockID clock_id; + if (!sel->playing) { + GST_DEBUG_OBJECT (selpad, "Waiting for playing"); + GST_INPUT_SELECTOR_WAIT (sel); + GST_DEBUG_OBJECT (selpad, "Done waiting"); + continue; + } + base_time = gst_element_get_base_time (GST_ELEMENT_CAST (sel)); if (!GST_CLOCK_TIME_IS_VALID (base_time)) { GST_DEBUG_OBJECT (selpad, "sync-mode=clock but no base time. Blocking"); @@ -853,13 +860,6 @@ gst_input_selector_wait_running_time (GstInputSelector * sel, continue; } - if (!sel->playing) { - GST_DEBUG_OBJECT (selpad, "Waiting for playing"); - GST_INPUT_SELECTOR_WAIT (sel); - GST_DEBUG_OBJECT (selpad, "Done waiting"); - continue; - } - /* FIXME: If no upstream latency was queried yet, do one now */ clock_id = gst_clock_new_single_shot_id (clock, |