uri-clip: use duration-limit in set_max_duration

Use the duration-limit rather than max-duration - in-point, since the
former will be able to take other factors, such as effects, into
account.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
This commit is contained in:
Henry Wilkes 2020-04-28 18:01:04 +01:00
parent 4b62749336
commit 5e144d9ade

View file

@ -388,14 +388,17 @@ gboolean
uri_clip_set_max_duration (GESTimelineElement * element,
GstClockTime maxduration)
{
if (_DURATION (element) == GST_CLOCK_TIME_NONE || _DURATION (element) == 0)
/* If we don't have a valid duration, use the max duration */
/* FIXME: don't do this when we have time effects */
_set_duration0 (element, maxduration - _INPOINT (element));
return
gboolean ret =
GES_TIMELINE_ELEMENT_CLASS (parent_class)->set_max_duration (element,
maxduration);
if (ret) {
GstClockTime limit = ges_clip_get_duration_limit (GES_CLIP (element));
if (GST_CLOCK_TIME_IS_VALID (limit) && (element->duration == 0))
_set_duration0 (element, limit);
}
return ret;
}
/**