mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

Previously any `CuesWithTiming.durationUs` could be `TIME_UNSET`, meaning it should be replaced by the next `CuesWithTiming` instance (instead of being merged if the durations overlap, which is currently the expected behavior for all `CuesWithTiming` with a 'real' duration). This technically allowed a single subtitle track to include a mixture of `CuesWithTiming` that should be merged, and some that should be replaced. This is not actually needed for any of the subtitle formats currently supported by ExoPlayer - in all cases a format expects either all cues to be merged, or each cue to replace the previous one. Supporting this mixture of merging and replacing in `TextRenderer` ended up being very complicated, and it seemed a bit pointless since it's not actually needed. This change means a given subtitle track either merges **all** cues (meaning `CuesWithTiming.durationUs = C.TIME_UNSET` is not allowed), or **every** cue is replaced by the next one (meaning `CuesWithTiming.durationUs` may be set (to allow for cues to 'time out', needed for CEA-608), or may be `TIME_UNSET`). This value will be used in a subsequent change that adds cue-merging support to `TextRenderer`. PiperOrigin-RevId: 565028066