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

This plumbs a duration through `SampleQueue` which will make it easier to handle transcoding muxed subtitles from e.g. SubRip to `text/x-exoplayer-cues`. This change is a no-op to the end-to-end behaviour of ExoPlayer because currently we only support parsing sideloaded subtitles before `SampleQueue`, and by adding the duration we don't affect the cues that are ultimately output by `Player.Listener.onCues` (as shown by no change to the golden files for `WebvttPlaybackTest` in this commit). I considered making `CuesWithStartTimeAndDuration` implement `Bundleable` (and deleting `CueEncoder/Decoder`) but decided against it because we are deliberately not encoding `startTimeUs` (since that's encoded as the sample time in `SampleQueue`). I also considered introducing another type that only has `List<Cue>` and `durationUs` fields, but it didn't seem necessary, since we want `startTimeUs` everywhere else (except inside `SampleQueue`). PiperOrigin-RevId: 545226847