Fix EAC3 bsid parsing
Comply with ETSI TS 102 366 V1.4.1 E.1.3.1.6
Bug: 125456292
Test: see repro steps
Change-Id: Ieb8414d83e63a3c968409c31e8130ada7238c5d4
diff --git a/media/extractors/mp4/MPEG4Extractor.cpp b/media/extractors/mp4/MPEG4Extractor.cpp
index 4b4d767..c776c51 100755
--- a/media/extractors/mp4/MPEG4Extractor.cpp
+++ b/media/extractors/mp4/MPEG4Extractor.cpp
@@ -3021,8 +3021,10 @@
}
unsigned bsid = br.getBits(5);
- if (bsid < 8) {
- ALOGW("Incorrect bsid in EAC3 header. Possibly AC-3?");
+ if (bsid == 9 || bsid == 10) {
+ ALOGW("EAC3 stream (bsid=%d) may be silenced by the decoder", bsid);
+ } else if (bsid > 16) {
+ ALOGE("EAC3 stream (bsid=%d) is not compatible with ETSI TS 102 366 v1.4.1", bsid);
delete[] chunk;
return ERROR_MALFORMED;
}