mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
pad: Break sticky event array iterations if the type is bigger than the one we look for
Microoptimization we can do because the array is sorted by type.
This commit is contained in:
parent
7f0e0ff3ca
commit
1176fbf6dc
1 changed files with 7 additions and 1 deletions
|
@ -471,6 +471,8 @@ find_event_by_type (GstPad * pad, GstEventType type, guint idx)
|
|||
if (idx == 0)
|
||||
goto found;
|
||||
idx--;
|
||||
} else if (GST_EVENT_TYPE (ev->event) > type) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ev = NULL;
|
||||
|
@ -493,6 +495,8 @@ find_event (GstPad * pad, GstEvent * event)
|
|||
ev = &g_array_index (events, PadEvent, i);
|
||||
if (event == ev->event)
|
||||
goto found;
|
||||
else if (GST_EVENT_TYPE (ev->event) > GST_EVENT_TYPE (event))
|
||||
break;
|
||||
}
|
||||
ev = NULL;
|
||||
found:
|
||||
|
@ -516,7 +520,9 @@ remove_event_by_type (GstPad * pad, GstEventType type)
|
|||
if (ev->event == NULL)
|
||||
goto next;
|
||||
|
||||
if (GST_EVENT_TYPE (ev->event) != type)
|
||||
if (GST_EVENT_TYPE (ev->event) > type)
|
||||
break;
|
||||
else if (GST_EVENT_TYPE (ev->event) != type)
|
||||
goto next;
|
||||
|
||||
gst_event_unref (ev->event);
|
||||
|
|
Loading…
Reference in a new issue