From 76647f2710d718e27f207b005956b7dba72c2d19 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Fri, 26 Jul 2013 15:29:05 +0200 Subject: [PATCH] oggdemux: Prevent seeks when _SCHEDULING_FLAG_SEQUENTIAL is set Don't go into pull mode when the upstream scheduling flags indicate seeks should be avoided by setting GST_SCHEDULING_FLAG_SEQUENTIAL. https://bugzilla.gnome.org/show_bug.cgi?id=704929 --- ext/ogg/gstoggdemux.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 4fbb697..98bc712 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -4586,7 +4586,8 @@ static gboolean gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent) { GstQuery *query; - gboolean pull_mode; + gboolean pull_mode = FALSE; + GstSchedulingFlags flags; query = gst_query_new_scheduling (); @@ -4595,8 +4596,13 @@ gst_ogg_demux_sink_activate (GstPad * sinkpad, GstObject * parent) goto activate_push; } - pull_mode = gst_query_has_scheduling_mode_with_flags (query, - GST_PAD_MODE_PULL, GST_SCHEDULING_FLAG_SEEKABLE); + gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL); + + /* Don't use pull mode if sequential access is suggested */ + if (gst_query_has_scheduling_mode (query, GST_PAD_MODE_PULL)) { + pull_mode = (flags & GST_SCHEDULING_FLAG_SEEKABLE) && + !(flags & GST_SCHEDULING_FLAG_SEQUENTIAL); + } gst_query_unref (query); if (!pull_mode) -- 2.7.4