uri-clip: don't assume duration needs to stay the same
authorHenry Wilkes <hwilkes@igalia.com>
Thu, 21 May 2020 10:25:30 +0000 (11:25 +0100)
committerHenry Wilkes <hwilkes@igalia.com>
Mon, 25 May 2020 10:20:38 +0000 (11:20 +0100)
commita6d0418f9935420c23fbbb7a03cdc91e30cde4c3
treec12e0045013a3cc73aa53ff7a42056980702ea6a
parentf269a7f2a62303c98b790cd6925b53c8939bb511
uri-clip: don't assume duration needs to stay the same

ges_uri_clip_asset_get_duration does not tell us what the duration in
the timeline needs to be. Especially when we have time effects, or
effects with finite max-durations. So we should no longer expect the
duration to stay the same when replacing assets. Instead, we just check
that the new max-duration would be compatible with the current in-point
(which was not checked before), and the clip would not be totally
overlapped if its duration-limit changes.

This is based on the assumption that each source is replaced one-to-one
in its track. If a source is replaced with nothing in the same track,
this check may be a little too strong (but still mostly weaker than
before). However, problems could occur if track selection does
something unexpected, such as placing the new source in a track not
previously occupied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/177>
ges/ges-clip.c
ges/ges-internal.h
ges/ges-uri-clip.c
tests/check/ges/asset.c