From e0dee7f4c1d455280bfabe346477aeb6cbe3c223 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Wed, 17 Oct 2018 19:43:51 +0300 Subject: oggdemux: Answer POSITION query --- ext/ogg/gstoggdemux.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 767f9b6ec..a4e10749b 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -252,6 +252,19 @@ gst_ogg_pad_src_query (GstPad * pad, GstObject * parent, GstQuery * query) ogg = GST_OGG_DEMUX (parent); switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_POSITION: + { + GstFormat format; + GstOggPad *ogg_pad = GST_OGG_PAD (pad); + + gst_query_parse_position (query, &format, NULL); + /* can only get position in time */ + if (format != GST_FORMAT_TIME) + goto wrong_format; + + gst_query_set_position (query, format, ogg_pad->position); + break; + } case GST_QUERY_DURATION: { GstFormat format; @@ -385,7 +398,7 @@ done: /* ERRORS */ wrong_format: { - GST_DEBUG_OBJECT (ogg, "only query duration on TIME is supported"); + GST_DEBUG_OBJECT (ogg, "only query position/duration on TIME is supported"); res = FALSE; goto done; } -- cgit v1.2.3