summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOgnyan Tonchev <ognyan@axis.com>2014-09-17 14:18:49 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-09-19 09:38:14 +0300
commitdc912c6d88a76445c47e4046f53034fac058c676 (patch)
tree377473bb6888a1959c4162c55f87d44ba95a17d1
parenta7beaf8707ab6f6d16c7706f0236ab1ea715b83e (diff)
downloadgstreamer-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.c9
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);