[FFmpeg-devel] [PATCH 07/14] avradio/sdrdemux: snap2station consider more distant stations

Michael Niedermayer michael at niedermayer.cc
Wed Jul 19 00:45:35 EEST 2023


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavradio/sdrdemux.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index c284f7d8d8..b22d3fed13 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -1321,7 +1321,10 @@ static int snap2station(SDRContext *sdr, int *seek_direction) {
     } else
         current_view = sdr->station_freq;
 
-    nb_stations = ff_sdr_find_stations(sdr, current_view, sdr->sdr_sample_rate*0.5, station_list, FF_ARRAY_ELEMS(station_list));
+    //We accept up to a a bandwidth steps minus a bit more than a typical FM channel distance. That ensures we will not have unscanned
+    //areas between the currently vissible and the vissible with the new station
+    //alternatively we could use half sdr->sample_rate or half sdr->bandwidth to be more conservative
+    nb_stations = ff_sdr_find_stations(sdr, current_view, sdr->bandwidth - 250*1000, station_list, FF_ARRAY_ELEMS(station_list));
 
     for(int i = 0; i<nb_stations; i++) {
         Station *station = station_list[i];
-- 
2.31.1



More information about the ffmpeg-devel mailing list