From b7b839a06f26b88b4e7b97a2e039f3e907225982 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 18 Apr 2020 23:58:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Device.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Common/Device.cpp b/src/Common/Device.cpp index e67578da..91408acc 100644 --- a/src/Common/Device.cpp +++ b/src/Common/Device.cpp @@ -64,8 +64,8 @@ void DevChannel::inputPCM(char* pcData, int iDataLen, uint32_t uiStamp) { if (_pAacEnc) { unsigned char *pucOut; int iRet = _pAacEnc->inputData(pcData, iDataLen, &pucOut); - if (iRet > 0) { - inputAAC((char *) pucOut + 7, iRet, uiStamp, pucOut); + if (iRet > 7) { + inputAAC((char *) pucOut + 7, iRet - 7, uiStamp, (char *)pucOut); } } } @@ -147,10 +147,10 @@ void DevChannel::inputAAC(const char *data_without_adts, int len, uint32_t dts, if(adts_header){ if(adts_header + 7 == data_without_adts){ - //adts头和帧再一起 + //adts头和帧在一起 inputFrame(std::make_shared((char *)data_without_adts - 7, len + 7, dts, 0, 7)); }else{ - //adts头和帧不再一起 + //adts头和帧不在一起 char *dataWithAdts = new char[len + 7]; memcpy(dataWithAdts, adts_header, 7); memcpy(dataWithAdts + 7 , data_without_adts , len);