appsrc: duration query support based on the size property

https://bugzilla.gnome.org/show_bug.cgi?id=759126
This commit is contained in:
Philippe Normand 2015-12-08 11:15:34 +01:00 committed by Sebastian Dröge
parent 8b49a3f845
commit 872f40d7d9

View file

@ -926,6 +926,18 @@ gst_app_src_query (GstBaseSrc * src, GstQuery * query)
res = TRUE;
break;
}
case GST_QUERY_DURATION:
{
GstFormat format;
gst_query_parse_duration (query, &format, NULL);
if (format == GST_FORMAT_BYTES) {
gst_query_set_duration (query, format, priv->size);
res = TRUE;
} else {
res = FALSE;
}
break;
}
default:
res = GST_BASE_SRC_CLASS (parent_class)->query (src, query);
break;