Handle edit lists with one 0 duration edit.

Issue: #1102
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111497855
This commit is contained in:
andrewlewis 2016-01-06 04:25:42 -08:00 committed by Oliver Woodman
parent 5b54dc5f8f
commit d740bf9f23

View File

@ -262,6 +262,17 @@ import java.util.List;
// implementation handles simple discarding/delaying of samples. The extractor may place // implementation handles simple discarding/delaying of samples. The extractor may place
// further restrictions on what edited streams are playable. // 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. // Count the number of samples after applying edits.
int editedSampleCount = 0; int editedSampleCount = 0;
int nextSampleIndex = 0; int nextSampleIndex = 0;