mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
urisourcebin: When streams-aware, remove pads immediately
For the same reason we add them immediately Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1905>
This commit is contained in:
parent
8648182fd1
commit
a6f213ad62
1 changed files with 8 additions and 2 deletions
|
@ -103,6 +103,7 @@ struct _ChildSrcPadInfo
|
||||||
* the pad owns the ChildSrcPadInfo as qdata */
|
* the pad owns the ChildSrcPadInfo as qdata */
|
||||||
GstPad *src_pad;
|
GstPad *src_pad;
|
||||||
GstCaps *cur_caps; /* holds ref */
|
GstCaps *cur_caps; /* holds ref */
|
||||||
|
GstPad *ghost_pad; /* ghostpad if any */
|
||||||
|
|
||||||
/* Configured output slot, if any */
|
/* Configured output slot, if any */
|
||||||
OutputSlotInfo *output_slot;
|
OutputSlotInfo *output_slot;
|
||||||
|
@ -673,11 +674,11 @@ new_demuxer_pad_added_cb (GstElement * element, GstPad * pad,
|
||||||
/* If the demuxer handles buffering and is streams-aware, we can expose it
|
/* If the demuxer handles buffering and is streams-aware, we can expose it
|
||||||
as-is directly. We still add an event probe to deal with EOS */
|
as-is directly. We still add an event probe to deal with EOS */
|
||||||
if (urisrc->demuxer_handles_buffering && urisrc->source_streams_aware) {
|
if (urisrc->demuxer_handles_buffering && urisrc->source_streams_aware) {
|
||||||
GstPad *ghostpad = create_output_pad (urisrc, pad);
|
info->ghost_pad = create_output_pad (urisrc, pad);
|
||||||
GST_DEBUG_OBJECT (element,
|
GST_DEBUG_OBJECT (element,
|
||||||
"New streams-aware demuxer pad %s:%s , exposing directly",
|
"New streams-aware demuxer pad %s:%s , exposing directly",
|
||||||
GST_DEBUG_PAD_NAME (pad));
|
GST_DEBUG_PAD_NAME (pad));
|
||||||
expose_output_pad (urisrc, ghostpad);
|
expose_output_pad (urisrc, info->ghost_pad);
|
||||||
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
|
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG_OBJECT (element, "new demuxer pad, name: <%s>. "
|
GST_DEBUG_OBJECT (element, "new demuxer pad, name: <%s>. "
|
||||||
|
@ -1414,6 +1415,11 @@ pad_removed_cb (GstElement * element, GstPad * pad, GstURISourceBin * urisrc)
|
||||||
remove_output_pad (urisrc, info->output_pad);
|
remove_output_pad (urisrc, info->output_pad);
|
||||||
} else {
|
} else {
|
||||||
GST_LOG_OBJECT (urisrc, "Removed pad has no output slot or pad");
|
GST_LOG_OBJECT (urisrc, "Removed pad has no output slot or pad");
|
||||||
|
if (urisrc->source_streams_aware) {
|
||||||
|
GST_DEBUG_OBJECT (info->ghost_pad,
|
||||||
|
"Streams-aware, removing pad immediately");
|
||||||
|
gst_element_remove_pad ((GstElement *) urisrc, info->ghost_pad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
|
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue