From 8b15f5a8ab44e3d63909d40e5cabf3db574ebc63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 11 Aug 2012 09:53:49 +0100 Subject: [PATCH] oggmux: don't leak dropped seek event --- ext/ogg/gstoggmux.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 4d60af3053..b628e60c70 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -523,16 +523,17 @@ gst_ogg_mux_handle_src_event (GstPad * pad, GstObject * parent, { gboolean res = FALSE; GstOggMux *ogg_mux = GST_OGG_MUX (parent); - GstEventType type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN; - switch (type) { + switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK:{ GstSeekFlags flags; gst_event_parse_seek (event, NULL, NULL, &flags, NULL, NULL, NULL, NULL); if (!ogg_mux->need_headers && (flags & GST_SEEK_FLAG_FLUSH) != 0) { - /* disable flushing seeks once we started */ - goto eat; + /* don't allow flushing seeks once we started */ + gst_event_unref (event); + event = NULL; + res = FALSE; } break; } @@ -540,8 +541,9 @@ gst_ogg_mux_handle_src_event (GstPad * pad, GstObject * parent, break; } - res = gst_pad_event_default (pad, parent, event); -eat: + if (event != NULL) + res = gst_pad_event_default (pad, parent, event); + return res; }