From 673dafd09d3a4223753cd50446b3fd3405e2042e Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 10 Jul 2012 08:13:02 +0200 Subject: [PATCH] oggmux: only drop flushing seeks after we started to mux Don't drop all seek events. It is okay to seek before we send the headers. Non flushing seeks are okay at any time later as well. --- ext/ogg/gstoggmux.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 0620e3157b..943c94ab35 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -521,19 +521,28 @@ static gboolean gst_ogg_mux_handle_src_event (GstPad * pad, GstObject * parent, GstEvent * event) { - GstEventType type; - - type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN; + gboolean res = FALSE; + GstOggMux *ogg_mux = GST_OGG_MUX (parent); + GstEventType type = event ? GST_EVENT_TYPE (event) : GST_EVENT_UNKNOWN; switch (type) { - case GST_EVENT_SEEK: - /* disable seeking for now */ - return FALSE; + 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; + } + break; + } default: break; } - return gst_pad_event_default (pad, parent, event); + res = gst_pad_event_default (pad, parent, event); +eat: + return res; } static GstBuffer *