TRANSPORTDEC_ERROR transportDec_CrcCheck(HANDLE_TRANSPORTDEC pTp) { switch (pTp->transportFmt) { case TT_MP4_ADTS: if ( (pTp->parser.adts.bs.num_raw_blocks > 0) && (pTp->parser.adts.bs.protection_absent == 0) ) { HANDLE_FDK_BITSTREAM hBs = &pTp->bitStream[0]; transportDec_AdjustEndOfAccessUnit(pTp); } return adtsRead_CrcCheck(&pTp->parser.adts); case TT_DRM: return drmRead_CrcCheck(&pTp->parser.drm); break; default: return TRANSPORTDEC_OK; } }
TRANSPORTDEC_ERROR transportDec_CrcCheck(HANDLE_TRANSPORTDEC pTp) { switch (pTp->transportFmt) { case TT_MP4_ADTS: if ( (pTp->parser.adts.bs.num_raw_blocks > 0) && (pTp->parser.adts.bs.protection_absent == 0) ) { HANDLE_FDK_BITSTREAM hBs = &pTp->bitStream[0]; int bitDiff; /* Calculate possible offset to CRC value. */ bitDiff = pTp->parser.adts.rawDataBlockDist[pTp->parser.adts.bs.num_raw_blocks-pTp->numberOfRawDataBlocks]<<3; bitDiff -= pTp->globalFramePos - FDKgetValidBits(hBs) + 16; FDKpushBiDirectional(hBs, bitDiff); pTp->parser.adts.crcReadValue = FDKreadBits(hBs, 16); } return adtsRead_CrcCheck(&pTp->parser.adts); default: return TRANSPORTDEC_OK; } }