diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-05-05 02:09:46 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-05 02:09:46 +0000 |
commit | 696a3cf9e8f2cccb9a12d3ab4c0adcbde433f205 (patch) | |
tree | 238f457a4e04cad87c5b5287e4c6a54555052433 /libSBRdec/src/sbrdecoder.cpp | |
parent | c7facc625aaf36a8445124db9383d38b72bf0d59 (diff) | |
parent | 47ee0b94ab44add7dfeb004b74714038e98d4d31 (diff) | |
download | fdk-aac-696a3cf9e8f2cccb9a12d3ab4c0adcbde433f205.tar.gz fdk-aac-696a3cf9e8f2cccb9a12d3ab4c0adcbde433f205.tar.bz2 fdk-aac-696a3cf9e8f2cccb9a12d3ab4c0adcbde433f205.zip |
Merge changes I42956a9f,I92f7c559,I5af62590 into sc-dev am: 826719dee4 am: 47ee0b94ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/aac/+/14373120
Change-Id: If591824a987260de27b479e8844906bbcd710031
Diffstat (limited to 'libSBRdec/src/sbrdecoder.cpp')
-rw-r--r-- | libSBRdec/src/sbrdecoder.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index b101a4a..7718695 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -961,8 +961,10 @@ SBR_ERROR sbrDecoder_SetParam(HANDLE_SBRDECODER self, const SBRDEC_PARAM param, /* Set sync state UPSAMPLING for the corresponding slot. This switches off bitstream parsing until a new header arrives. */ - hSbrHeader->syncState = UPSAMPLING; - hSbrHeader->status |= SBRDEC_HDR_STAT_UPDATE; + if (hSbrHeader->syncState != SBR_NOT_INITIALIZED) { + hSbrHeader->syncState = UPSAMPLING; + hSbrHeader->status |= SBRDEC_HDR_STAT_UPDATE; + } } } } break; @@ -1371,7 +1373,9 @@ SBR_ERROR sbrDecoder_Parse(HANDLE_SBRDECODER self, HANDLE_FDK_BITSTREAM hBs, } if (headerStatus == HEADER_ERROR) { /* Corrupt SBR info data, do not decode and switch to UPSAMPLING */ - hSbrHeader->syncState = UPSAMPLING; + hSbrHeader->syncState = hSbrHeader->syncState > UPSAMPLING + ? UPSAMPLING + : hSbrHeader->syncState; fDoDecodeSbrData = 0; sbrHeaderPresent = 0; } @@ -1610,7 +1614,9 @@ static SBR_ERROR sbrDecoder_DecodeElement( /* No valid SBR payload available, hence switch to upsampling (in all * headers) */ for (hdrIdx = 0; hdrIdx < ((1) + 1); hdrIdx += 1) { - self->sbrHeader[elementIndex][hdrIdx].syncState = UPSAMPLING; + if (self->sbrHeader[elementIndex][hdrIdx].syncState > UPSAMPLING) { + self->sbrHeader[elementIndex][hdrIdx].syncState = UPSAMPLING; + } } } else { /* Move frame pointer to the next slot which is up to be decoded/applied |