B-Netz, NMT: Improved check for minimum required sample rate

This commit is contained in:
Andreas Eversberg committed 2017-02-18 21:01:15 +01:00
1 parent 7e45f556ce
commit f72c53757d
2 files changed
+11 -7

No files matched your search

+6 -2
View File
@@ -83,8 +83,12 @@ int dsp_init_sender(bnetz_t *bnetz)
sample_t *spl;
int i;
if ((bnetz->sender.samplerate % 1000)) {
PDEBUG(DDSP, DEBUG_ERROR, "Samples rate must be a multiple of 1000 bits per second.\n");
if ((bnetz->sender.samplerate % (int)(1.0 / (double)BIT_DURATION))) {
PDEBUG(DDSP, DEBUG_ERROR, "Samples rate must be a multiple of %d bits per second.\n", (int)(1.0 / (double)BIT_DURATION));
return -EINVAL;
}
if ((bnetz->sender.samplerate % (int)(1.0 / (double)FILTER_STEP))) {
PDEBUG(DDSP, DEBUG_ERROR, "Samples rate must be a multiple of %d bits per second.\n", (int)(1.0 / (double)FILTER_STEP));
return -EINVAL;
}