mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
pad: small cleanup
This commit is contained in:
parent
6c627481b3
commit
e91b1ee412
1 changed files with 13 additions and 12 deletions
25
gst/gstpad.c
25
gst/gstpad.c
|
@ -332,6 +332,13 @@ gst_pad_init (GstPad * pad)
|
||||||
g_hook_list_init (&pad->probes, sizeof (GstProbe));
|
g_hook_list_init (&pad->probes, sizeof (GstProbe));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clear_event (PadEvent events[], guint idx)
|
||||||
|
{
|
||||||
|
gst_event_replace (&events[idx].event, NULL);
|
||||||
|
gst_event_replace (&events[idx].pending, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* called when setting the pad inactive. It removes all sticky events from
|
/* called when setting the pad inactive. It removes all sticky events from
|
||||||
* the pad */
|
* the pad */
|
||||||
static void
|
static void
|
||||||
|
@ -339,10 +346,8 @@ clear_events (PadEvent events[])
|
||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
for (i = 0; i < GST_EVENT_MAX_STICKY; i++) {
|
for (i = 0; i < GST_EVENT_MAX_STICKY; i++)
|
||||||
gst_event_replace (&events[i].event, NULL);
|
clear_event (events, i);
|
||||||
gst_event_replace (&events[i].pending, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The sticky event with @idx from the srcpad is copied to the
|
/* The sticky event with @idx from the srcpad is copied to the
|
||||||
|
@ -4244,10 +4249,8 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
|
||||||
|
|
||||||
/* Remove sticky EOS events */
|
/* Remove sticky EOS events */
|
||||||
GST_LOG_OBJECT (pad, "Removing pending EOS events");
|
GST_LOG_OBJECT (pad, "Removing pending EOS events");
|
||||||
gst_event_replace (&pad->priv->
|
clear_event (pad->priv->events,
|
||||||
events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
|
GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS));
|
||||||
gst_event_replace (&pad->priv->
|
|
||||||
events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
|
|
||||||
|
|
||||||
if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) {
|
if (G_UNLIKELY (GST_PAD_IS_BLOCKED (pad))) {
|
||||||
GST_LOG_OBJECT (pad, "Pad is blocked, not forwarding flush-stop");
|
GST_LOG_OBJECT (pad, "Pad is blocked, not forwarding flush-stop");
|
||||||
|
@ -4457,10 +4460,8 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
|
||||||
}
|
}
|
||||||
/* Remove pending EOS events */
|
/* Remove pending EOS events */
|
||||||
GST_LOG_OBJECT (pad, "Removing pending EOS events");
|
GST_LOG_OBJECT (pad, "Removing pending EOS events");
|
||||||
gst_event_replace (&pad->priv->
|
clear_event (pad->priv->events,
|
||||||
events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].pending, NULL);
|
GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS));
|
||||||
gst_event_replace (&pad->priv->
|
|
||||||
events[GST_EVENT_STICKY_IDX_TYPE (GST_EVENT_EOS)].event, NULL);
|
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
/* grab stream lock */
|
/* grab stream lock */
|
||||||
|
|
Loading…
Reference in a new issue