videoencoder: do not leak events when flushing them

https://bugzilla.gnome.org/show_bug.cgi?id=736796
This commit is contained in:
Ognyan Tonchev 2014-09-17 14:08:17 +02:00 committed by Sebastian Dröge
parent 5a3ebef605
commit d8260cdb89

View file

@ -310,13 +310,12 @@ _flush_events (GstPad * pad, GList * events)
GList *tmp; GList *tmp;
for (tmp = events; tmp; tmp = tmp->next) { for (tmp = events; tmp; tmp = tmp->next) {
if (GST_EVENT_TYPE (tmp->data) == GST_EVENT_EOS || if (GST_EVENT_TYPE (tmp->data) != GST_EVENT_EOS &&
GST_EVENT_TYPE (tmp->data) == GST_EVENT_SEGMENT || GST_EVENT_TYPE (tmp->data) != GST_EVENT_SEGMENT &&
!GST_EVENT_IS_STICKY (tmp->data)) { GST_EVENT_IS_STICKY (tmp->data)) {
gst_event_unref (tmp->data);
} else {
gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data)); gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data));
} }
gst_event_unref (tmp->data);
} }
g_list_free (events); g_list_free (events);