case GST_QUERY_DURATION:
{
GstFormat format;
+ gint64 total_time;
gst_query_parse_duration (query, &format, NULL);
/* can only get position in time */
if (format != GST_FORMAT_TIME)
goto wrong_format;
- /* can only return the total time position */
- /* FIXME, return time for this specific stream */
- gst_query_set_duration (query, GST_FORMAT_TIME, ogg->total_time);
+ if (ogg->seekable) {
+ /* we must return the total seekable length */
+ total_time = ogg->total_time;
+ } else {
+ /* in non-seek mode we can answer the query and we must return -1 */
+ total_time = -1;
+ }
+
+ gst_query_set_duration (query, GST_FORMAT_TIME, total_time);
break;
}
case GST_QUERY_SEEKING: