mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-01 14:11:15 +00:00
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/6455>
This commit is contained in:
parent
4020144a65
commit
0d04d702bd
1 changed files with 7 additions and 7 deletions
|
@ -839,6 +839,13 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
|
||||||
GstClockTimeDiff jitter;
|
GstClockTimeDiff jitter;
|
||||||
GstClockID clock_id;
|
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));
|
base_time = gst_element_get_base_time (GST_ELEMENT_CAST (sel));
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (base_time)) {
|
if (!GST_CLOCK_TIME_IS_VALID (base_time)) {
|
||||||
GST_DEBUG_OBJECT (selpad, "sync-mode=clock but no base time. Blocking");
|
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;
|
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 */
|
/* FIXME: If no upstream latency was queried yet, do one now */
|
||||||
clock_id =
|
clock_id =
|
||||||
gst_clock_new_single_shot_id (clock,
|
gst_clock_new_single_shot_id (clock,
|
||||||
|
|
Loading…
Reference in a new issue