mirror of
https://github.com/rehlds/revoice.git
synced 2024-12-27 23:25:53 +03:00
Typo in CSteamP2PCodec::Compress
This commit is contained in:
parent
81a705a87a
commit
8eb9367dcd
@ -112,7 +112,7 @@ int CSteamP2PCodec::Compress(const char *pUncompressedBytes, int nSamples, char
|
||||
}
|
||||
writePos += encodeRes;
|
||||
|
||||
uint32 cksum = crc32(pUncompressedBytes, writePos - pCompressed);
|
||||
uint32 cksum = crc32(pCompressed, writePos - pCompressed);
|
||||
*(uint32*)writePos = cksum;
|
||||
writePos += 4;
|
||||
|
||||
|
@ -109,7 +109,6 @@ int VoiceEncoder_Silk::Compress(const char *pUncompressedIn, int nSamplesIn, cha
|
||||
int16 nBytes = originalNBytes;
|
||||
int res = SKP_Silk_SDK_Encode(this->m_pEncoder, &this->m_encControl, psRead, nSamplesToEncode, (unsigned char*)pWritePos, &nBytes);
|
||||
*pWritePayloadSize = nBytes; //write frame size
|
||||
printf("enc: res=%d; outlen=%d;\n", res, nBytes);
|
||||
|
||||
pWritePos += nBytes;
|
||||
psRead += nSamplesToEncode;
|
||||
|
@ -54,7 +54,26 @@ int TranscodeVoice(const char* srcBuf, int srcBufLen, IVoiceCodec* srcCodec, IVo
|
||||
return 0;
|
||||
}
|
||||
|
||||
return dstCodec->Compress(decodedBuf, numDecodedSamples, dstBuf, dstBufSize, false);
|
||||
|
||||
int compressedSize = dstCodec->Compress(decodedBuf, numDecodedSamples, dstBuf, dstBufSize, false);
|
||||
if (compressedSize <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
int numDecodedSamples2 = dstCodec->Decompress(dstBuf, compressedSize, decodedBuf, sizeof(decodedBuf));
|
||||
if (numDecodedSamples2 <= 0) {
|
||||
return compressedSize;
|
||||
}
|
||||
|
||||
FILE* rawSndFile = fopen("d:\\revoice_raw.snd", "ab");
|
||||
if (rawSndFile) {
|
||||
fwrite(decodedBuf, 2, numDecodedSamples2, rawSndFile);
|
||||
fclose(rawSndFile);
|
||||
}
|
||||
*/
|
||||
|
||||
return compressedSize;
|
||||
}
|
||||
|
||||
void SV_ParseVoiceData_emu(IGameClient* cl) {
|
||||
|
Loading…
Reference in New Issue
Block a user