Allowing client to know stream duration when no seeking happened.
https://bugzilla.gnome.org/show_bug.cgi?id=783435
if (format != GST_FORMAT_TIME)
*stop = -1;
}
+
gst_query_unref (query);
+ if (!GST_CLOCK_TIME_IS_VALID (*stop)) {
+ query = gst_query_new_duration (GST_FORMAT_TIME);
+ if ((ret = gst_element_query (sink, query))) {
+ GstFormat format;
+
+ gst_query_parse_duration (query, &format, stop);
+ if (format != GST_FORMAT_TIME)
+ *stop = -1;
+ }
+ gst_query_unref (query);
+ }
+
gst_object_unref (sink);
return ret;