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 DA154461B1 for ; Sat, 8 Jul 2023 21:26:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B5A3268C567; Sun, 9 Jul 2023 00:25:44 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D65768C54F for ; Sun, 9 Jul 2023 00:25:37 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id ACE49FF803 for ; Sat, 8 Jul 2023 21:25:36 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 8 Jul 2023 23:25:17 +0200 Message-Id: <20230708212530.109692-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230708212530.109692-1-michael@niedermayer.cc> References: <20230708212530.109692-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 05/18] avradio/sdrdemux: Do not timeout negative 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: If we identified that a station is an artifact of the SDR, we dont want to timeout that to avoid it being redetected as station Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index 13cec10505..39eaa0c094 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -347,6 +347,7 @@ static void decay_stations(SDRContext *sdr) for (int i=0; ifrequency - station->bandwidth/2 < sdr->block_center_freq - sdr->bandwidth/2 || station->frequency + station->bandwidth/2 > sdr->block_center_freq + sdr->bandwidth/2) @@ -355,9 +356,10 @@ static void decay_stations(SDRContext *sdr) if (station->timeout) station->non_detection_per_mix_frequency[histogram_index(sdr, station->frequency)] ++; + hs = histogram_score(station); + if (station->in_station_list) { int station_timeout = STATION_TIMEOUT; - int hs = histogram_score(station); if (hs == 0) { station_timeout = 5; //give the station a moment to be properly detected and then discard it @@ -370,7 +372,13 @@ static void decay_stations(SDRContext *sdr) station->in_station_list = 0; } } else { - if (station->timeout++ > CANDIDATE_STATION_TIMEOUT) { + int station_timeout = CANDIDATE_STATION_TIMEOUT; + + //We do not want to drop "negative" stations to avoid them being redetected + if (hs <= 0) + station_timeout = INT_MAX; + + if (station->timeout++ > station_timeout) { struct AVTreeNode *next = NULL; tree_remove(&sdr->station_root, station, station_cmp, &next); av_freep(&next); -- 2.31.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".