From 62e3ac3e9ed96c5b76efe6a78b0bc905a565f3be 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 f7b4040144..e06a3278f0 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 @@ -363,9 +363,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);