From 263ac3e867e64032707e61ed44a729eeff17d4e9 Mon Sep 17 00:00:00 2001 From: "Christian W. Zuckschwerdt" Date: Sun, 19 Jul 2026 13:23:37 +0200 Subject: [PATCH] Fix automatic discriminator selection for file input (#3554) --- include/rtl_433.h | 8 ++++---- src/rtl_433.c | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/rtl_433.h b/include/rtl_433.h index 299fbf6e..e01ca641 100644 --- a/include/rtl_433.h +++ b/include/rtl_433.h @@ -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]; diff --git a/src/rtl_433.c b/src/rtl_433.c index ecc63b33..8e767e82 100644 --- a/src/rtl_433.c +++ b/src/rtl_433.c @@ -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 {