mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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
2 changed files with 9 additions and 6 deletions
|
|
@ -61,7 +61,10 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
|
||||||
* readers.
|
* readers.
|
||||||
*/
|
*/
|
||||||
public DefaultTsPayloadReaderFactory(@Flags int flags) {
|
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) {
|
public DefaultTsPayloadReaderFactory(@Flags int flags, List<Format> closedCaptionFormats) {
|
||||||
this.flags = flags;
|
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;
|
this.closedCaptionFormats = closedCaptionFormats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,11 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
|
||||||
// The playlist declares closed caption renditions, we should ignore descriptors.
|
// The playlist declares closed caption renditions, we should ignore descriptors.
|
||||||
esReaderFactoryFlags |= DefaultTsPayloadReaderFactory.FLAG_OVERRIDE_CAPTION_DESCRIPTORS;
|
esReaderFactoryFlags |= DefaultTsPayloadReaderFactory.FLAG_OVERRIDE_CAPTION_DESCRIPTORS;
|
||||||
} else {
|
} 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;
|
String codecs = format.codecs;
|
||||||
if (!TextUtils.isEmpty(codecs)) {
|
if (!TextUtils.isEmpty(codecs)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue