mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-26 12:27:51 +02:00
fix SDR++ server crash at high samplerates #1326
This commit is contained in:
@ -12,6 +12,10 @@ namespace dsp::compression {
|
||||
|
||||
void init(stream<complex_t>* in, PCMType pcmType) {
|
||||
_pcmType = pcmType;
|
||||
|
||||
// Set the output buffer size to the max size of a complex buffer + 8 bytes for the header
|
||||
out.setBufferSize(STREAM_BUFFER_SIZE*sizeof(complex_t) + 8);
|
||||
|
||||
base_type::init(in);
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ namespace server {
|
||||
// Compress data if needed and fill out header fields
|
||||
if (compression) {
|
||||
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND_COMPRESSED;
|
||||
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE, data, count, 1);
|
||||
bb_pkt_hdr->size = sizeof(PacketHeader) + (uint32_t)ZSTD_compressCCtx(cctx, &bbuf[sizeof(PacketHeader)], SERVER_MAX_PACKET_SIZE-sizeof(PacketHeader), data, count, 1);
|
||||
}
|
||||
else {
|
||||
bb_pkt_hdr->type = PACKET_TYPE_BASEBAND;
|
||||
|
Reference in New Issue
Block a user