mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
inputselector: Never reset active pad set from the user
This was leading to interesting races in a GES test. Related to: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/108 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/481>
This commit is contained in:
parent
8076051a19
commit
9f2e9ccd7e
2 changed files with 5 additions and 2 deletions
|
@ -1427,6 +1427,7 @@ gst_input_selector_set_property (GObject * object, guint prop_id,
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_LOCK (sel);
|
GST_INPUT_SELECTOR_LOCK (sel);
|
||||||
|
|
||||||
|
sel->active_sinkpad_from_user = ! !pad;
|
||||||
#if DEBUG_CACHED_BUFFERS
|
#if DEBUG_CACHED_BUFFERS
|
||||||
gst_input_selector_debug_cached_buffers (sel);
|
gst_input_selector_debug_cached_buffers (sel);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1814,6 +1815,7 @@ gst_input_selector_release_pad (GstElement * element, GstPad * pad)
|
||||||
GST_DEBUG_OBJECT (sel, "Deactivating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_OBJECT (sel, "Deactivating pad %s:%s", GST_DEBUG_PAD_NAME (pad));
|
||||||
gst_object_unref (sel->active_sinkpad);
|
gst_object_unref (sel->active_sinkpad);
|
||||||
sel->active_sinkpad = NULL;
|
sel->active_sinkpad = NULL;
|
||||||
|
sel->active_sinkpad_from_user = FALSE;
|
||||||
}
|
}
|
||||||
sel->n_pads--;
|
sel->n_pads--;
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
|
@ -1829,7 +1831,7 @@ gst_input_selector_reset (GstInputSelector * sel)
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_LOCK (sel);
|
GST_INPUT_SELECTOR_LOCK (sel);
|
||||||
/* clear active pad */
|
/* clear active pad */
|
||||||
if (sel->active_sinkpad) {
|
if (sel->active_sinkpad && !sel->active_sinkpad_from_user) {
|
||||||
gst_object_unref (sel->active_sinkpad);
|
gst_object_unref (sel->active_sinkpad);
|
||||||
sel->active_sinkpad = NULL;
|
sel->active_sinkpad = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,8 @@ struct _GstInputSelector {
|
||||||
|
|
||||||
GstPad *srcpad;
|
GstPad *srcpad;
|
||||||
|
|
||||||
GstPad *active_sinkpad;
|
gboolean active_sinkpad_from_user;
|
||||||
|
GstPad* active_sinkpad;
|
||||||
guint n_pads; /* number of pads */
|
guint n_pads; /* number of pads */
|
||||||
guint padcount; /* sequence number for pads */
|
guint padcount; /* sequence number for pads */
|
||||||
gboolean sync_streams;
|
gboolean sync_streams;
|
||||||
|
|
Loading…
Reference in a new issue