Commit 2fee0109 by olly Committed by Oliver Woodman

Workaround/Fix #3351

1. Ignore edit list where the sequence doesn't contain a sync
   sample, rather than failing.
2. Make Mp4Extractor.readAtomPayload so it doesn't try and read
   the same payload twice if a failure occurs parsing it.
3. Make processAtomEnded so that it doesn't pop the moov if
   parsing it fails.

Issue: #3351

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172106244
parent c9ed9366
...@@ -395,7 +395,11 @@ import java.util.List; ...@@ -395,7 +395,11 @@ import java.util.List;
hasSyncSample |= (editedFlags[i] & C.BUFFER_FLAG_KEY_FRAME) != 0; hasSyncSample |= (editedFlags[i] & C.BUFFER_FLAG_KEY_FRAME) != 0;
} }
if (!hasSyncSample) { if (!hasSyncSample) {
throw new ParserException("The edited sample sequence does not contain a sync sample."); // We don't support edit lists where the edited sample sequence doesn't contain a sync sample.
// Such edit lists are often (although not always) broken, so we ignore it and continue.
Log.w(TAG, "Ignoring edit list: Edited sample sequence does not contain a sync sample.");
Util.scaleLargeTimestampsInPlace(timestamps, C.MICROS_PER_SECOND, track.timescale);
return new TrackSampleTable(offsets, sizes, maximumSize, timestamps, flags);
} }
return new TrackSampleTable(editedOffsets, editedSizes, editedMaximumSize, editedTimestamps, return new TrackSampleTable(editedOffsets, editedSizes, editedMaximumSize, editedTimestamps,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment