Commit 284b7e7f by andrewlewis Committed by Oliver Woodman

Comment (e-)AC-3/DTS descriptor tags.

Also, use terminology from ATSC spec in Ac3Util comment.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112254908
parent 0900c535
...@@ -46,6 +46,7 @@ public final class TsExtractor implements Extractor { ...@@ -46,6 +46,7 @@ public final class TsExtractor implements Extractor {
private static final int TS_STREAM_TYPE_MPA_LSF = 0x04; private static final int TS_STREAM_TYPE_MPA_LSF = 0x04;
private static final int TS_STREAM_TYPE_AAC = 0x0F; private static final int TS_STREAM_TYPE_AAC = 0x0F;
private static final int TS_STREAM_TYPE_AC3 = 0x81; private static final int TS_STREAM_TYPE_AC3 = 0x81;
private static final int TS_STREAM_TYPE_DTS = 0x8A;
private static final int TS_STREAM_TYPE_E_AC3 = 0x87; private static final int TS_STREAM_TYPE_E_AC3 = 0x87;
private static final int TS_STREAM_TYPE_H262 = 0x02; private static final int TS_STREAM_TYPE_H262 = 0x02;
private static final int TS_STREAM_TYPE_H264 = 0x1B; private static final int TS_STREAM_TYPE_H264 = 0x1B;
...@@ -326,7 +327,7 @@ public final class TsExtractor implements Extractor { ...@@ -326,7 +327,7 @@ public final class TsExtractor implements Extractor {
continue; continue;
} }
ElementaryStreamReader pesPayloadReader = null; ElementaryStreamReader pesPayloadReader;
switch (streamType) { switch (streamType) {
case TS_STREAM_TYPE_MPA: case TS_STREAM_TYPE_MPA:
pesPayloadReader = new MpegAudioReader(output.track(TS_STREAM_TYPE_MPA)); pesPayloadReader = new MpegAudioReader(output.track(TS_STREAM_TYPE_MPA));
...@@ -358,6 +359,9 @@ public final class TsExtractor implements Extractor { ...@@ -358,6 +359,9 @@ public final class TsExtractor implements Extractor {
case TS_STREAM_TYPE_ID3: case TS_STREAM_TYPE_ID3:
pesPayloadReader = id3Reader; pesPayloadReader = id3Reader;
break; break;
default:
pesPayloadReader = null;
break;
} }
if (pesPayloadReader != null) { if (pesPayloadReader != null) {
...@@ -394,12 +398,12 @@ public final class TsExtractor implements Extractor { ...@@ -394,12 +398,12 @@ public final class TsExtractor implements Extractor {
streamType = TS_STREAM_TYPE_H265; streamType = TS_STREAM_TYPE_H265;
} }
break; break;
} else if (descriptorTag == 0x6A) { } else if (descriptorTag == 0x6A) { // AC-3_descriptor in DVB (ETSI EN 300 468)
streamType = TS_STREAM_TYPE_AC3; streamType = TS_STREAM_TYPE_AC3;
} else if (descriptorTag == 0x7A) { } else if (descriptorTag == 0x7A) { // enhanced_AC-3_descriptor
streamType = TS_STREAM_TYPE_E_AC3; streamType = TS_STREAM_TYPE_E_AC3;
} else if (descriptorTag == 0x7B) { } else if (descriptorTag == 0x7B) { // DTS_descriptor
// TODO: TS_STREAM_TYPE_DTS; streamType = TS_STREAM_TYPE_DTS;
} }
data.skipBytes(descriptorLength); data.skipBytes(descriptorLength);
......
...@@ -152,7 +152,7 @@ public final class Ac3Util { ...@@ -152,7 +152,7 @@ public final class Ac3Util {
*/ */
public static MediaFormat parseEac3SyncframeFormat(ParsableBitArray data, String trackId, public static MediaFormat parseEac3SyncframeFormat(ParsableBitArray data, String trackId,
long durationUs, String language) { long durationUs, String language) {
data.skipBits(16 + 2 + 3 + 11); // syncword, strmtype, strmid, frmsiz data.skipBits(16 + 2 + 3 + 11); // syncword, strmtype, substreamid, frmsiz
int sampleRate; int sampleRate;
int fscod = data.readBits(2); int fscod = data.readBits(2);
if (fscod == 3) { if (fscod == 3) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment