aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-05-04 17:41:40 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-04 17:41:40 -0700
commitb2ce5c82bd4288b0e55d23f8cbf1d51150d752fc (patch)
tree8bf6f33f28355cd7dd6c4f5a01c5324a43ec66bc /libMpegTPDec
parent2ef3dc81e5bfa012a5b1b7fce573fdd1b73130e8 (diff)
parent259a3c5bd5eb9be666f40dfb2978502533dd2b82 (diff)
downloadfdk-aac-b2ce5c82bd4288b0e55d23f8cbf1d51150d752fc.tar.gz
fdk-aac-b2ce5c82bd4288b0e55d23f8cbf1d51150d752fc.tar.bz2
fdk-aac-b2ce5c82bd4288b0e55d23f8cbf1d51150d752fc.zip
FDKv2 additional fixes am: 9ab67882ec
am: 259a3c5bd5 Change-Id: Iac5c03364819ea0ef7a91cccfc0b62af0b19b612
Diffstat (limited to 'libMpegTPDec')
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp2
-rw-r--r--libMpegTPDec/src/tpdec_latm.cpp10
-rw-r--r--libMpegTPDec/src/tpdec_lib.cpp6
3 files changed, 14 insertions, 4 deletions
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index abe66e5..74beaa6 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -2488,7 +2488,7 @@ TRANSPORTDEC_ERROR DrmRawSdcAudioConfig_Parse(
switch (audioCoding) {
case 0: /* AAC */
- if (coderField >> 2) {
+ if ((coderField >> 2) && (audioMode != 1)) {
self->m_aot = AOT_DRM_SURROUND; /* Set pseudo AOT for Drm Surround */
} else {
self->m_aot = AOT_DRM_AAC; /* Set pseudo AOT for Drm AAC */
diff --git a/libMpegTPDec/src/tpdec_latm.cpp b/libMpegTPDec/src/tpdec_latm.cpp
index b4f7372..2edf055 100644
--- a/libMpegTPDec/src/tpdec_latm.cpp
+++ b/libMpegTPDec/src/tpdec_latm.cpp
@@ -126,7 +126,6 @@ static TRANSPORTDEC_ERROR CLatmDemux_ReadAudioMuxElement(
CSTpCallBacks *pTpDecCallbacks, CSAudioSpecificConfig *pAsc,
int *pfConfigFound) {
TRANSPORTDEC_ERROR ErrorStatus = TRANSPORTDEC_OK;
- UCHAR applyAsc = pLatmDemux->applyAsc;
if (m_muxConfigPresent) {
pLatmDemux->m_useSameStreamMux = FDKreadBits(bs, 1);
@@ -152,7 +151,12 @@ static TRANSPORTDEC_ERROR CLatmDemux_ReadAudioMuxElement(
goto bail;
}
- if (pLatmDemux->newCfgHasAudioPreRoll) {
+ /* Allow flushing only when audioPreroll functionality is enabled in
+ * current and new config otherwise the new config can be applied
+ * immediately. */
+ if (pAsc->m_sc.m_usacConfig.element[0]
+ .extElement.usacExtElementHasAudioPreRoll &&
+ pLatmDemux->newCfgHasAudioPreRoll) {
pLatmDemux->newCfgHasAudioPreRoll = 0;
/* with audioPreRoll we must flush before applying new cfg */
pLatmDemux->applyAsc = 0;
@@ -223,7 +227,7 @@ static TRANSPORTDEC_ERROR CLatmDemux_ReadAudioMuxElement(
bail:
if (ErrorStatus != TRANSPORTDEC_OK) {
- pLatmDemux->applyAsc = applyAsc;
+ pLatmDemux->applyAsc = 1;
}
return (ErrorStatus);
diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp
index 10e3352..306bec0 100644
--- a/libMpegTPDec/src/tpdec_lib.cpp
+++ b/libMpegTPDec/src/tpdec_lib.cpp
@@ -1151,6 +1151,12 @@ static TRANSPORTDEC_ERROR synchronization(HANDLE_TRANSPORTDEC hTp,
&syncLayerFrameBits, &fConfigFound,
&headerBits);
if (TPDEC_IS_FATAL_ERROR(err)) {
+ /* Rewind - TPDEC_SYNCSKIP, in order to look for a synch one bit ahead
+ * next time. Ensure that the bit amount lands at a multiple of
+ * TPDEC_SYNCSKIP. */
+ FDKpushBiDirectional(
+ hBs, -headerBits + TPDEC_SYNCSKIP + (bitsAvail % TPDEC_SYNCSKIP));
+
goto bail;
}
}