mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 15:56:42 +00:00
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:
parent
4b62749336
commit
5e144d9ade
1 changed files with 9 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue