Commit edd3d57e authored by Sebastian Dröge's avatar Sebastian Dröge 🍵 Committed by Tim-Philipp Müller

oggdemux: Answer POSITION query

parent b1d020f6
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment