diff options
author | Ognyan Tonchev <ognyan@axis.com> | 2014-09-17 14:18:49 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-09-19 09:38:14 +0300 |
commit | dc912c6d88a76445c47e4046f53034fac058c676 (patch) | |
tree | 377473bb6888a1959c4162c55f87d44ba95a17d1 | |
parent | a7beaf8707ab6f6d16c7706f0236ab1ea715b83e (diff) | |
download | gstreamer-plugins-base-dc912c6d88a76445c47e4046f53034fac058c676.tar.gz |
audioencoder: do not leak events when flushing them
https://bugzilla.gnome.org/show_bug.cgi?id=736796
-rw-r--r-- | gst-libs/gst/audio/gstaudioencoder.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index a94fd0130..fda988736 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -1441,13 +1441,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); |