mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 09:41:07 +00:00
urisourcebin: Set pad probe before linking pad
We want to grab all events that pass through, so we need to set the probe **before** the pad is linked Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7609>
This commit is contained in:
parent
c97126212f
commit
b2c0f490f0
1 changed files with 7 additions and 5 deletions
|
@ -884,11 +884,6 @@ new_demuxer_pad_added_cb (GstElement * element, GstPad * pad,
|
|||
slot = new_output_slot (info, pad);
|
||||
output_pad = gst_object_ref (slot->output_pad);
|
||||
|
||||
slot->demuxer_event_probe_id =
|
||||
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM |
|
||||
GST_PAD_PROBE_TYPE_EVENT_FLUSH, (GstPadProbeCallback) demux_pad_events,
|
||||
slot, NULL);
|
||||
|
||||
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
|
||||
expose_output_pad (urisrc, output_pad);
|
||||
gst_object_unref (output_pad);
|
||||
|
@ -1275,11 +1270,18 @@ new_output_slot (ChildSrcPadInfo * info, GstPad * originating_pad)
|
|||
gst_pad_sticky_events_foreach (originating_pad, copy_sticky_events,
|
||||
©_data);
|
||||
|
||||
if (info->demuxer) {
|
||||
/* Make sure we add the event probe *before* linking */
|
||||
slot->demuxer_event_probe_id =
|
||||
gst_pad_add_probe (originating_pad,
|
||||
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH,
|
||||
(GstPadProbeCallback) demux_pad_events, slot, NULL);
|
||||
}
|
||||
|
||||
slot->output_pad = create_output_pad (slot, srcpad);
|
||||
gst_object_unref (srcpad);
|
||||
gst_pad_link (originating_pad, slot->queue_sinkpad);
|
||||
GST_PAD_STREAM_UNLOCK (originating_pad);
|
||||
}
|
||||
/* If buffering is required, create the element. If downloadbuffer is
|
||||
* required, it will take precedence over queue2 */
|
||||
|
|
Loading…
Reference in a new issue