Flexibilize mp4 extensions detection for HLS chunks

This CL adds support  mp4 extensions of the form .m4_.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=146479870
This commit is contained in:
aquilescanta 2017-02-03 09:01:31 -08:00 committed by Oliver Woodman
parent d3f4da749c
commit 7c8a3d006d

View file

@ -56,6 +56,7 @@ import java.util.concurrent.atomic.AtomicInteger;
private static final String EC3_FILE_EXTENSION = ".ec3";
private static final String MP3_FILE_EXTENSION = ".mp3";
private static final String MP4_FILE_EXTENSION = ".mp4";
private static final String M4_FILE_EXTENSION_PREFIX = ".m4";
private static final String VTT_FILE_EXTENSION = ".vtt";
private static final String WEBVTT_FILE_EXTENSION = ".webvtt";
@ -341,7 +342,8 @@ import java.util.concurrent.atomic.AtomicInteger;
// Only reuse TS and fMP4 extractors.
usingNewExtractor = false;
extractor = previousExtractor;
} else if (lastPathSegment.endsWith(MP4_FILE_EXTENSION)) {
} else if (lastPathSegment.endsWith(MP4_FILE_EXTENSION)
|| lastPathSegment.startsWith(M4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 4)) {
extractor = new FragmentedMp4Extractor(0, timestampAdjuster);
} else {
// MPEG-2 TS segments, but we need a new extractor.