mirror of
https://github.com/samsonjs/media.git
synced 2026-04-21 13:55:47 +00:00
Ignore file extension for HLS Subtitle Renditions
According to the spec, subtitle renditions must be Webvtt media segments. Issue:#2025 Issue:#2355 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=145289266
This commit is contained in:
parent
18d7cdf39f
commit
497651c7b9
1 changed files with 5 additions and 4 deletions
|
|
@ -187,7 +187,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
public void load() throws IOException, InterruptedException {
|
||||
if (extractor == null && !isPackedAudio) {
|
||||
// See HLS spec, version 20, Section 3.4 for more information on packed audio extraction.
|
||||
extractor = buildExtractorByExtension();
|
||||
extractor = createExtractor();
|
||||
}
|
||||
maybeLoadInitData();
|
||||
if (!loadCanceled) {
|
||||
|
|
@ -329,11 +329,12 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
return new Aes128DataSource(dataSource, encryptionKey, encryptionIv);
|
||||
}
|
||||
|
||||
private Extractor buildExtractorByExtension() {
|
||||
// Set the extractor that will read the chunk.
|
||||
private Extractor createExtractor() {
|
||||
// Select the extractor that will read the chunk.
|
||||
Extractor extractor;
|
||||
boolean usingNewExtractor = true;
|
||||
if (lastPathSegment.endsWith(WEBVTT_FILE_EXTENSION)
|
||||
if (MimeTypes.TEXT_VTT.equals(hlsUrl.format.sampleMimeType)
|
||||
|| lastPathSegment.endsWith(WEBVTT_FILE_EXTENSION)
|
||||
|| lastPathSegment.endsWith(VTT_FILE_EXTENSION)) {
|
||||
extractor = new WebvttExtractor(trackFormat.language, timestampAdjuster);
|
||||
} else if (!needNewExtractor) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue