mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
typefind: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case. https://bugzilla.gnome.org/show_bug.cgi?id=709868
This commit is contained in:
parent
066fdcd432
commit
a91b51c9b7
1 changed files with 15 additions and 3 deletions
|
@ -642,15 +642,27 @@ gst_type_find_element_sink_event (GstPad * pad, GstObject * parent,
|
|||
res = gst_pad_push_event (typefind->src, event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
case GST_EVENT_FLUSH_STOP:{
|
||||
GList *l;
|
||||
|
||||
GST_OBJECT_LOCK (typefind);
|
||||
g_list_foreach (typefind->cached_events,
|
||||
(GFunc) gst_mini_object_unref, NULL);
|
||||
|
||||
for (l = typefind->cached_events; l; l = l->next) {
|
||||
if (!GST_EVENT_IS_STICKY (l->data) ||
|
||||
GST_EVENT_TYPE (l->data) == GST_EVENT_SEGMENT ||
|
||||
GST_EVENT_TYPE (l->data) == GST_EVENT_EOS) {
|
||||
gst_event_unref (l->data);
|
||||
} else {
|
||||
gst_pad_store_sticky_event (typefind->src, l->data);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (typefind->cached_events);
|
||||
typefind->cached_events = NULL;
|
||||
gst_adapter_clear (typefind->adapter);
|
||||
GST_OBJECT_UNLOCK (typefind);
|
||||
/* fall through */
|
||||
}
|
||||
case GST_EVENT_FLUSH_START:
|
||||
res = gst_pad_push_event (typefind->src, event);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue