GST_QUERY_POSITION,
GST_QUERY_DURATION,
GST_QUERY_CONVERT,
+ GST_QUERY_SEEKING,
0,
};
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:{
GstFormat fmt;
-
gint64 pos;
gst_query_parse_position (query, &fmt, NULL);
case GST_QUERY_DURATION:{
GstFormat fmt;
-
gint64 len;
gst_query_parse_duration (query, &fmt, NULL);
case GST_QUERY_CONVERT:{
GstFormat src_fmt, dest_fmt;
-
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, NULL);
break;
}
+ case GST_QUERY_SEEKING:{
+ GstFormat fmt;
+ gboolean seekable = FALSE;
+
+ res = TRUE;
+ /* If upstream can handle the query we're done */
+ seekable = gst_pad_peer_query (flacdec->sinkpad, query);
+ if (seekable)
+ gst_query_parse_seeking (query, NULL, &seekable, NULL, NULL);
+ if (seekable)
+ goto done;
+
+ gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
+ if ((fmt != GST_FORMAT_TIME && fmt != GST_FORMAT_DEFAULT) ||
+ !flacdec->seekable_decoder) {
+ gst_query_set_seeking (query, fmt, FALSE, -1, -1);
+ } else {
+ gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1);
+ }
+ break;
+ }
default:{
res = gst_pad_query_default (pad, query);