* the pad owns the ChildSrcPadInfo as qdata */
GstPad *src_pad;
GstCaps *cur_caps; /* holds ref */
+ GstPad *ghost_pad; /* ghostpad if any */
/* Configured output slot, if any */
OutputSlotInfo *output_slot;
/* 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 */
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,
"New streams-aware demuxer pad %s:%s , exposing directly",
GST_DEBUG_PAD_NAME (pad));
- expose_output_pad (urisrc, ghostpad);
+ expose_output_pad (urisrc, info->ghost_pad);
GST_URI_SOURCE_BIN_UNLOCK (urisrc);
} else {
GST_DEBUG_OBJECT (element, "new demuxer pad, name: <%s>. "
remove_output_pad (urisrc, info->output_pad);
} else {
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);