diff options
| author | Mooneer Salem <[email protected]> | 2024-03-29 08:58:26 -0700 |
|---|---|---|
| committer | Mooneer Salem <[email protected]> | 2024-03-29 08:58:26 -0700 |
| commit | 203b3f7c3d9711aea479a331741c3b4edc8ce4b8 (patch) | |
| tree | 79fed412bd0787db812532b30fee155989faf37b | |
| parent | 40758ecf5f86a0345d519ce44b594c7ce3e0fc0e (diff) | |
Use a minimum of 8 bytes for the payload bits.
| -rw-r--r-- | src/freedv_fsk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/freedv_fsk.c b/src/freedv_fsk.c index 69aa8b9..2660ea1 100644 --- a/src/freedv_fsk.c +++ b/src/freedv_fsk.c @@ -123,7 +123,8 @@ void freedv_800xa_open(struct freedv *f) { f->bits_per_codec_frame = codec2_bits_per_frame(f->codec2); f->bits_per_modem_frame = f->n_codec_frames * f->bits_per_codec_frame; - int n_packed_bytes = ceil((f->bits_per_modem_frame + 7.0) / 8.0) + 1; + int n_packed_bytes = ceil((f->bits_per_modem_frame + 7.0) / 8.0) + 1; /* ~3.5 bits per frame, which needs to be rounded up to 4. */ + if (n_packed_bytes < 8) n_packed_bytes = 8; f->tx_payload_bits = MALLOC(n_packed_bytes); assert(f->tx_payload_bits != NULL); f->rx_payload_bits = MALLOC(n_packed_bytes); |
