diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2012-07-10 08:13:02 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2012-07-16 11:27:57 +0200 |
commit | 673dafd09d3a4223753cd50446b3fd3405e2042e (patch) | |
tree | 546a551ce48eed98e6f9a18376c38634a7b8d464 /ext/ogg | |
parent | 3d8636a662becde77a9b37c2a1ef228fcf42aeda (diff) |
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.
Diffstat (limited to 'ext/ogg')
-rw-r--r-- | ext/ogg/gstoggmux.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 0620e3157..943c94ab3 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 * |