Merge pull request #1105 from IanDBird/eac3-fixes

Improve identification of (E)AC3 content in MPEGTS and tweak EAC3 parsing
This commit is contained in:
Andrew Lewis 2016-01-04 13:27:52 +00:00
commit 6eea4bdbc3
2 changed files with 8 additions and 1 deletions

View file

@ -392,7 +392,14 @@ public final class TsExtractor implements Extractor {
streamType = TS_STREAM_TYPE_H265;
}
break;
} else if (descriptorTag == 0x6a) {
streamType = TS_STREAM_TYPE_AC3;
} else if (descriptorTag == 0x7a) {
streamType = TS_STREAM_TYPE_E_AC3;
} else if (descriptorTag == 0x7b) {
// TODO: TS_STREAM_TYPE_DTS;
}
data.skipBytes(descriptorLength);
}
data.setPosition(descriptorsEndPosition);

View file

@ -152,7 +152,7 @@ public final class Ac3Util {
*/
public static MediaFormat parseEac3SyncframeFormat(ParsableBitArray data, String trackId,
long durationUs, String language) {
data.skipBits(16 + 2 + 11); // syncword, strmtype, frmsiz
data.skipBits(16 + 2 + 3 + 11); // syncword, strmtype, strmid, frmsiz
int sampleRate;
int fscod = data.readBits(2);
if (fscod == 3) {