diff options
author | Ognyan Tonchev <ognyan@axis.com> | 2014-09-17 14:08:17 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-09-19 09:38:14 +0300 |
commit | fa522f69a0801f476247920b4d2716a27d9045ba (patch) | |
tree | 21dc523725be8ee9510c902e07936f7dc13c6d1f | |
parent | 464cc52d6889688c6cabf56dad18622abc38b2bf (diff) | |
download | gstreamer-plugins-base-fa522f69a0801f476247920b4d2716a27d9045ba.tar.gz |
videoencoder: do not leak events when flushing them
https://bugzilla.gnome.org/show_bug.cgi?id=736796
-rw-r--r-- | gst-libs/gst/video/gstvideoencoder.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c index e0264d120..4c42a789a 100644 --- a/gst-libs/gst/video/gstvideoencoder.c +++ b/gst-libs/gst/video/gstvideoencoder.c @@ -311,13 +311,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); |