Enable HDMV DTS stream detection if a flag is set

Issue: #5330
PiperOrigin-RevId: 241381723
This commit is contained in:
andrewlewis 2019-04-01 20:55:48 +01:00 committed by Oliver Woodman
parent 2dc07fc461
commit 9dc22c3086
2 changed files with 11 additions and 7 deletions

View File

@ -18,6 +18,10 @@
* Support encrypted initialization segments
([#5441](https://github.com/google/ExoPlayer/issues/5441)).
* Parse `EXT-X-MEDIA` `CHARACTERISTICS` attribute into `Format.roleFlags`.
* MPEG-TS: enable HDMV DTS stream detection only if a flag is set. By default
(if the flag is not set), the 0x82 elementary stream type is now treated as an
SCTE subtitle track
([#5330](https://github.com/google/ExoPlayer/issues/5330)).
* `ExtractorMediaSource` renamed to `ProgressiveMediaSource`.
* Support for playing spherical videos on Daydream.
* Improve decoder re-use between playbacks. TODO: Write and link a blog post

View File

@ -38,7 +38,8 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
* Flags controlling elementary stream readers' behavior. Possible flag values are {@link
* #FLAG_ALLOW_NON_IDR_KEYFRAMES}, {@link #FLAG_IGNORE_AAC_STREAM}, {@link
* #FLAG_IGNORE_H264_STREAM}, {@link #FLAG_DETECT_ACCESS_UNITS}, {@link
* #FLAG_IGNORE_SPLICE_INFO_STREAM} and {@link #FLAG_OVERRIDE_CAPTION_DESCRIPTORS}.
* #FLAG_IGNORE_SPLICE_INFO_STREAM}, {@link #FLAG_OVERRIDE_CAPTION_DESCRIPTORS} and {@link
* #FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS}.
*/
@Documented
@Retention(RetentionPolicy.SOURCE)
@ -51,7 +52,7 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
FLAG_DETECT_ACCESS_UNITS,
FLAG_IGNORE_SPLICE_INFO_STREAM,
FLAG_OVERRIDE_CAPTION_DESCRIPTORS,
FLAG_IGNORE_HDMV_DTS_STREAM
FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS
})
public @interface Flags {}
@ -88,11 +89,10 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
*/
public static final int FLAG_OVERRIDE_CAPTION_DESCRIPTORS = 1 << 5;
/**
* Prevents the creation of {@link DtsReader} instances when receiving {@link
* TsExtractor#TS_STREAM_TYPE_HDMV_DTS} as stream type. Enabling this flag prevents a stream type
* collision between HDMV DTS audio and SCTE-35 subtitles.
* Sets whether HDMV DTS audio streams will be handled. If this flag is set, SCTE subtitles will
* not be detected, as they share the same elementary stream type as HDMV DTS.
*/
public static final int FLAG_IGNORE_HDMV_DTS_STREAM = 1 << 6;
public static final int FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS = 1 << 6;
private static final int DESCRIPTOR_TAG_CAPTION_SERVICE = 0x86;
@ -152,7 +152,7 @@ public final class DefaultTsPayloadReaderFactory implements TsPayloadReader.Fact
case TsExtractor.TS_STREAM_TYPE_AC4:
return new PesReader(new Ac4Reader(esInfo.language));
case TsExtractor.TS_STREAM_TYPE_HDMV_DTS:
if (isSet(FLAG_IGNORE_HDMV_DTS_STREAM)) {
if (!isSet(FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS)) {
return null;
}
// Fall through.