Update parseStbl to handle edit lists & gapless info

Without this, a subtitle track empty edit list used to offset the start of
subtitles is ignored.

Also the current code seems to depend on the order in which
we parse the tracks (audio first means we have gapless info when we parse
video track, while video first we wouldn't).

It's not clear why we can't handle both edit lists & gapless info

PiperOrigin-RevId: 276029744
This commit is contained in:
ibaker 2019-10-22 11:05:33 +01:00 committed by Oliver Woodman
parent 2dbc5755f6
commit 2c721130b1

View file

@ -348,9 +348,7 @@ import java.util.List;
}
long durationUs = Util.scaleLargeTimestamp(duration, C.MICROS_PER_SECOND, track.timescale);
if (track.editListDurations == null || gaplessInfoHolder.hasGaplessInfo()) {
// There is no edit list, or we are ignoring it as we already have gapless metadata to apply.
// This implementation does not support applying both gapless metadata and an edit list.
if (track.editListDurations == null) {
Util.scaleLargeTimestampsInPlace(timestamps, C.MICROS_PER_SECOND, track.timescale);
return new TrackSampleTable(
track, offsets, sizes, maximumSize, timestamps, flags, durationUs);