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 AB388461A8 for ; Sat, 8 Jul 2023 21:27:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DD4F968C5BD; Sun, 9 Jul 2023 00:25:50 +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 622C768C56C for ; Sun, 9 Jul 2023 00:25:45 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id BA44DC0002 for ; Sat, 8 Jul 2023 21:25:44 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 8 Jul 2023 23:25:26 +0200 Message-Id: <20230708212530.109692-14-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 14/18] avradio/sdrdemux: fm_probe: dont allow bandwidh=sample rate 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 bandwidth is set incorrectly the noise floor can be very wrong, which causes issues as the threshold is based on the noise floor Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index 5300311c3a..b51fa4296a 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -843,7 +843,7 @@ static int probe_fm(SDRContext *sdr) int bandwidth_p2 = 38*1000; //phase 2 bandwidth int half_bw_i = bandwidth_f * (int64_t)sdr->block_size / sdr->sdr_sample_rate; float last_score[3] = {FLT_MAX, FLT_MAX, FLT_MAX}; - int border_i = (sdr->sdr_sample_rate - sdr->bandwidth) * sdr->block_size / sdr->sdr_sample_rate; + int border_i = (sdr->sdr_sample_rate - FFMIN(sdr->bandwidth, sdr->sdr_sample_rate*7/8)) * sdr->block_size / sdr->sdr_sample_rate; double noise_floor = FLT_MAX; if (2*half_bw_i > 2*sdr->block_size) -- 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".