mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
oggdemux: Answer POSITION query
This commit is contained in:
parent
3499d9ea64
commit
e0dee7f4c1
1 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue