From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7017A467A5 for ; Tue, 18 Jul 2023 21:46:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1294168C5D2; Wed, 19 Jul 2023 00:46:04 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E7C6D68C36B for ; Wed, 19 Jul 2023 00:46:02 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9DD7EC0002 for ; Tue, 18 Jul 2023 21:45:50 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 18 Jul 2023 23:45:35 +0200 Message-Id: <20230718214542.685375-7-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230718214542.685375-1-michael@niedermayer.cc> References: <20230718214542.685375-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 07/14] avradio/sdrdemux: snap2station consider more distant stations X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- 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