mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-29 18:48:44 +00:00
hlsdemux: Give a proper name to the srcpads and remove it when resetting the element
This commit is contained in:
parent
d436844434
commit
13997abbf9
2 changed files with 12 additions and 2 deletions
|
@ -645,12 +645,15 @@ switch_pads (GstHLSDemux * demux, GstCaps * newcaps)
|
|||
GstPad *oldpad = demux->srcpad;
|
||||
GstEvent *event;
|
||||
gchar *stream_id;
|
||||
gchar *name;
|
||||
|
||||
GST_DEBUG ("Switching pads (oldpad:%p) with caps: %" GST_PTR_FORMAT, oldpad,
|
||||
newcaps);
|
||||
|
||||
/* First create and activate new pad */
|
||||
demux->srcpad = gst_pad_new_from_static_template (&srctemplate, NULL);
|
||||
name = g_strdup_printf ("src_%u", demux->srcpad_counter++);
|
||||
demux->srcpad = gst_pad_new_from_static_template (&srctemplate, name);
|
||||
g_free (name);
|
||||
gst_pad_set_event_function (demux->srcpad,
|
||||
GST_DEBUG_FUNCPTR (gst_hls_demux_src_event));
|
||||
gst_pad_set_query_function (demux->srcpad,
|
||||
|
@ -879,6 +882,12 @@ gst_hls_demux_reset (GstHLSDemux * demux, gboolean dispose)
|
|||
|
||||
demux->have_group_id = FALSE;
|
||||
demux->group_id = G_MAXUINT;
|
||||
|
||||
demux->srcpad_counter = 0;
|
||||
if (demux->srcpad) {
|
||||
gst_element_remove_pad (GST_ELEMENT_CAST (demux), demux->srcpad);
|
||||
demux->srcpad = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -55,8 +55,9 @@ struct _GstHLSDemux
|
|||
{
|
||||
GstElement parent;
|
||||
|
||||
GstPad *srcpad;
|
||||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
gint srcpad_counter;
|
||||
|
||||
gboolean have_group_id;
|
||||
guint group_id;
|
||||
|
|
Loading…
Reference in a new issue