From 29f548a7cd10ee22060afe16f81db080ca66f202 Mon Sep 17 00:00:00 2001 From: Ognyan Tonchev Date: Wed, 17 Sep 2014 14:11:21 +0200 Subject: [PATCH] videodecoder: do not leak events when flushing them https://bugzilla.gnome.org/show_bug.cgi?id=736796 --- gst-libs/gst/video/gstvideodecoder.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 703c1ad35e..289a4f8a2a 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1002,13 +1002,12 @@ _flush_events (GstPad * pad, GList * events) GList *tmp; for (tmp = events; tmp; tmp = tmp->next) { - if (GST_EVENT_TYPE (tmp->data) == GST_EVENT_EOS || - GST_EVENT_TYPE (tmp->data) == GST_EVENT_SEGMENT || - !GST_EVENT_IS_STICKY (tmp->data)) { - gst_event_unref (tmp->data); - } else { + if (GST_EVENT_TYPE (tmp->data) != GST_EVENT_EOS && + GST_EVENT_TYPE (tmp->data) != GST_EVENT_SEGMENT && + GST_EVENT_IS_STICKY (tmp->data)) { gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data)); } + gst_event_unref (tmp->data); } g_list_free (events);