1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

Remote: base CRC32 number of bytes for calculation on data FEC size

This commit is contained in:
f4exb 2019-04-26 02:50:02 +02:00
parent 2833eb1b0e
commit 74a9c5d36c
4 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ void RemoteSink::feed(const SampleVector::const_iterator& begin, const SampleVec
}
boost::crc_32_type crc32;
crc32.process_bytes(&metaData, 24);
crc32.process_bytes(&metaData, sizeof(RemoteMetaDataFEC)-4);
metaData.m_crc32 = crc32.checksum();
RemoteSuperBlock& superBlock = m_dataBlock->m_superBlocks[0]; // first block
superBlock.init();

View File

@ -321,7 +321,7 @@ void RemoteSource::handleDataBlock(RemoteDataBlock* dataBlock)
{
RemoteMetaDataFEC *metaData = (RemoteMetaDataFEC *) &(dataBlock->m_superBlocks[0].m_protectedBlock);
boost::crc_32_type crc32;
crc32.process_bytes(metaData, 24);
crc32.process_bytes(metaData, sizeof(RemoteMetaDataFEC)-4);
if (crc32.checksum() == metaData->m_crc32)
{

View File

@ -134,7 +134,7 @@ void UDPSinkFEC::write(const SampleVector::iterator& begin, uint32_t sampleChunk
metaData.m_tv_usec = ts_usecs % 1000000UL;
boost::crc_32_type crc32;
crc32.process_bytes(&metaData, 24);
crc32.process_bytes(&metaData, sizeof(RemoteMetaDataFEC)-4);
metaData.m_crc32 = crc32.checksum();

View File

@ -284,7 +284,7 @@ void RemoteInputBuffer::writeData(char *array)
RemoteMetaDataFEC *metaData = (RemoteMetaDataFEC *) recoveredBlock;
boost::crc_32_type crc32;
crc32.process_bytes(metaData, 24);
crc32.process_bytes(metaData, sizeof(RemoteMetaDataFEC)-4);
if (crc32.checksum() == metaData->m_crc32)
{