diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2018-12-27 14:28:38 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-12-27 14:28:38 -0800 |
commit | f5512132f3850ab06a13b9e541cac51f6f389bf2 (patch) | |
tree | e78e88638c742d3dcd5f704d6ad50758d256a945 /libSBRdec/src/sbrdecoder.cpp | |
parent | 2027969e1f72be4464e48f1bc0065b2bed1590b9 (diff) | |
parent | ecc96969d7db139242dbba9930857ed5ce955b29 (diff) | |
download | fdk-aac-f5512132f3850ab06a13b9e541cac51f6f389bf2.tar.gz fdk-aac-f5512132f3850ab06a13b9e541cac51f6f389bf2.tar.bz2 fdk-aac-f5512132f3850ab06a13b9e541cac51f6f389bf2.zip |
Merge changes I97471c4d,I8a8626a8,I1f176740,I10da23ee,I9f9064fb
am: ecc96969d7
Change-Id: I588392116ecdf22e1266ec6fff8416fa87d911c4
Diffstat (limited to 'libSBRdec/src/sbrdecoder.cpp')
-rw-r--r-- | libSBRdec/src/sbrdecoder.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index e2455da..4bc6f69 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -1150,6 +1150,11 @@ SBR_ERROR sbrDecoder_Parse(HANDLE_SBRDECODER self, HANDLE_FDK_BITSTREAM hBs, int lastSlot, lastHdrSlot = 0, thisHdrSlot = 0; + if (*count <= 0) { + setFrameErrorFlag(self->pSbrElement[elementIndex], FRAME_ERROR); + return SBRDEC_OK; + } + /* SBR sanity checks */ if (self == NULL) { errorStatus = SBRDEC_NOT_INITIALIZED; @@ -1677,6 +1682,9 @@ static SBR_ERROR sbrDecoder_DecodeElement( /* reset */ if (hSbrHeader->status & SBRDEC_HDR_STAT_RESET) { int ch; + int applySbrProc = (hSbrHeader->syncState == SBR_ACTIVE || + (hSbrHeader->frameErrorFlag == 0 && + hSbrHeader->syncState == SBR_HEADER)); for (ch = 0; ch < numElementChannels; ch++) { SBR_ERROR errorStatusTmp = SBRDEC_OK; @@ -1688,7 +1696,9 @@ static SBR_ERROR sbrDecoder_DecodeElement( hSbrHeader->syncState = UPSAMPLING; } } - hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET; + if (applySbrProc) { + hSbrHeader->status &= ~SBRDEC_HDR_STAT_RESET; + } } /* decoding */ |