appsrc: handle duration query only if the property was set

https://bugzilla.gnome.org/show_bug.cgi?id=786200
This commit is contained in:
Philippe Normand 2017-08-12 15:46:28 +01:00
parent ce65017d03
commit d375a28a37

View file

@ -938,8 +938,12 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query)
gst_query_set_duration (query, format, priv->size); gst_query_set_duration (query, format, priv->size);
res = TRUE; res = TRUE;
} else if (format == GST_FORMAT_TIME) { } else if (format == GST_FORMAT_TIME) {
gst_query_set_duration (query, format, priv->duration); if (priv->duration != GST_CLOCK_TIME_NONE) {
res = TRUE; gst_query_set_duration (query, format, priv->duration);
res = TRUE;
} else {
res = FALSE;
}
} else { } else {
res = FALSE; res = FALSE;
} }