From 2c721130b1ea9efbbd83f8d0e75fbee63e1c6973 Mon Sep 17 00:00:00 2001 From: ibaker Date: Tue, 22 Oct 2019 11:05:33 +0100 Subject: [PATCH] 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 --- .../google/android/exoplayer2/extractor/mp4/AtomParsers.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java index c4e6ef17c4..58bd59a448 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java @@ -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);