Ensure TTML captions are clipped to sample boundaries
Created by: davemevans
To ease encoding and packaging of TTML segments, captions which span segment boundaries may appear in two segments with identical start and end times.
When an ISOBMFF segment becomes inactive (ie sample DTS plus duration has passed), anything related to that sample should be removed.
This PR ensures that captions in an ISOBMFF sample are clipped to the sample start and end times of that sample.
With our test asset http://rdmedia.bbc.co.uk/dash/ondemand/elephants_dream/1/client_manifest-all.mpd, this stops captions spanning a segment boundary appearing twice.
Note 1: In theory, the TTML parser should compute the intermediate synchronic document between each sample and determine that nothing has changed, but we do not currently have a full-featured TTML parser.
Note 2: sample CTS is used here to maintain existing functionality, though this has been previously been discussed (https://github.com/Dash-Industry-Forum/dash.js/pull/691#discussion_r36537984) and should be DTS.