Commit d740bf9f by andrewlewis Committed by Oliver Woodman

Handle edit lists with one 0 duration edit.

Issue: #1102
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111497855
parent 5b54dc5f
......@@ -262,6 +262,17 @@ import java.util.List;
// implementation handles simple discarding/delaying of samples. The extractor may place
// further restrictions on what edited streams are playable.
if (track.editListDurations.length == 1 && track.editListDurations[0] == 0) {
// The current version of the spec leaves handling of an edit with zero segment_duration in
// unfragmented files open to interpretation. We handle this as a special case and include all
// samples in the edit.
for (int i = 0; i < timestamps.length; i++) {
timestamps[i] = Util.scaleLargeTimestamp(timestamps[i] - track.editListMediaTimes[0],
C.MICROS_PER_SECOND, track.timescale);
}
return new TrackSampleTable(offsets, sizes, maximumSize, timestamps, flags);
}
// Count the number of samples after applying edits.
int editedSampleCount = 0;
int nextSampleIndex = 0;
......
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