diff -r aa1f309ec686 -r 2af89a257a86 gst-gmyth/nuvdemux/gstnuvdemux.c --- a/gst-gmyth/nuvdemux/gstnuvdemux.c Tue May 01 17:03:38 2007 +0100 +++ b/gst-gmyth/nuvdemux/gstnuvdemux.c Wed May 16 18:48:13 2007 +0100 @@ -610,28 +610,52 @@ gboolean res = FALSE; GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (pad)); - switch (GST_QUERY_TYPE (query)) { + + switch (GST_QUERY_TYPE (query)) + { case GST_QUERY_POSITION: - if (GST_CLOCK_TIME_IS_VALID (nuv->priv->last_frame_time)) { - gst_query_set_position (query, GST_FORMAT_TIME, nuv->priv->last_frame_time); - res = TRUE; - } - break; + { + GstFormat format; + gst_query_parse_position (query, &format, NULL); + switch (format) + { + case GST_FORMAT_TIME: + if (GST_CLOCK_TIME_IS_VALID (nuv->priv->last_frame_time)) { + gst_query_set_position (query, GST_FORMAT_TIME, nuv->priv->last_frame_time); + res = TRUE; + } + break; + default: + break; + } + break; + } case GST_QUERY_DURATION: - { - if (nuv->priv->duration_time != GST_CLOCK_TIME_NONE) { - gst_query_set_duration (query, GST_FORMAT_TIME, nuv->priv->duration_time); - res = TRUE; - } - } - break; - default: - res = FALSE; - break; + { + GstFormat format; + gst_query_parse_duration (query, &format, NULL); + switch (format) + { + case GST_FORMAT_TIME: + if (nuv->priv->duration_time != GST_CLOCK_TIME_NONE) { + gst_query_set_duration (query, GST_FORMAT_TIME, nuv->priv->duration_time); + res = TRUE; + } + break; + default: + break; + } + break; + } + default: + break; } + if (res==FALSE) { + res = gst_pad_query_default (pad, query); + } + gst_object_unref (nuv); - return res; }