Allow overridable empty closed caption format list in DefaultTsPayloadReaderFactory
Issue:#4451 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202923630
This commit is contained in:
parent
c23910ad3a
commit
caa90844c6
@ -61,7 +61,10 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
|
||||
* readers.
|
||||
*/
|
||||
public DefaultTsPayloadReaderFactory(@Flags int flags) {
|
||||
this(flags, Collections.<Format>emptyList());
|
||||
this(
|
||||
flags,
|
||||
Collections.singletonList(
|
||||
Format.createTextSampleFormat(null, MimeTypes.APPLICATION_CEA608, 0, null)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,10 +79,6 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
|
||||
*/
|
||||
public DefaultTsPayloadReaderFactory(@Flags int flags, List<Format> closedCaptionFormats) {
|
||||
this.flags = flags;
|
||||
if (!isSet(FLAG_OVERRIDE_CAPTION_DESCRIPTORS) && closedCaptionFormats.isEmpty()) {
|
||||
closedCaptionFormats = Collections.singletonList(Format.createTextSampleFormat(null,
|
||||
MimeTypes.APPLICATION_CEA608, 0, null));
|
||||
}
|
||||
this.closedCaptionFormats = closedCaptionFormats;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,11 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
|
||||
// The playlist declares closed caption renditions, we should ignore descriptors.
|
||||
esReaderFactoryFlags |= DefaultTsPayloadReaderFactory.FLAG_OVERRIDE_CAPTION_DESCRIPTORS;
|
||||
} else {
|
||||
muxedCaptionFormats = Collections.emptyList();
|
||||
// The playlist does not provide any closed caption information. We preemptively declare a
|
||||
// closed caption track on channel 0.
|
||||
muxedCaptionFormats =
|
||||
Collections.singletonList(
|
||||
Format.createTextSampleFormat(null, MimeTypes.APPLICATION_CEA608, 0, null));
|
||||
}
|
||||
String codecs = format.codecs;
|
||||
if (!TextUtils.isEmpty(codecs)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user