Fix automatic discriminator selection for file input (#3554)

This commit is contained in:
Christian W. Zuckschwerdt
2026-07-19 13:23:37 +02:00
committed by GitHub
parent 335d47e977
commit 263ac3e867
2 changed files with 5 additions and 6 deletions

View File

@@ -73,10 +73,10 @@ typedef struct r_cfg {
volatile sig_atomic_t hop_now; ///< flag to cause channel hopping, async written by signal handler and push_sdr_flow()
volatile sig_atomic_t exit_async; ///< flag to cause exiting, async written by signal handler
volatile sig_atomic_t exit_code; ///< 0=no err, 1=params or cmd line err, 2=sdr device read error, 3=usb init error, 5=USB error (reset), other=other error
int frequencies;
int frequency_index;
uint32_t frequency[MAX_FREQS];
uint32_t center_frequency;
int frequencies; ///< The number of entries in the frequency hopping list.
int frequency_index; ///< The current position in the frequency hopping list.
uint32_t frequency[MAX_FREQS]; ///< A list of hopping frequencies.
uint32_t center_frequency; ///< The current center frequency of the live or file input.
int fsk_pulse_detect_mode;
int hop_times;
int hop_time[MAX_FREQS];

View File

@@ -1093,8 +1093,7 @@ static void process_sdr_frame(r_cfg_t *cfg, unsigned char *iq_buf, uint32_t len)
// Select needed discriminator based on current frequency or manual setting
unsigned fpdm = cfg->fsk_pulse_detect_mode;
if (cfg->fsk_pulse_detect_mode == FSK_PULSE_DETECT_AUTO) {
// FIXME: this is wrong to be compatible with tests and won't work for file inputs
if (cfg->frequency[cfg->frequency_index] > FSK_PULSE_DETECTOR_LIMIT) {
if (cfg->center_frequency > FSK_PULSE_DETECTOR_LIMIT) {
fpdm = FSK_PULSE_DETECT_NEW;
}
else {