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 0B77F46BD2 for ; Tue, 4 Jul 2023 22:23:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3D69A68C65A; Wed, 5 Jul 2023 01:23:14 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6523D68C655 for ; Wed, 5 Jul 2023 01:23:08 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id 9BF9F60002 for ; Tue, 4 Jul 2023 22:23:07 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 5 Jul 2023 00:23:00 +0200 Message-Id: <20230704222302.1129450-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230704222302.1129450-1-michael@niedermayer.cc> References: <20230704222302.1129450-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] avradio/sdrdemux: adjust frequency precission in probing depending on modulation 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: for AM we can find the frequency very precissely, for FM currently not so much Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index 90f6805c3b..92b1e2b170 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -166,9 +166,10 @@ static int create_station(SDRContext *sdr, Station *candidate_station) { return best_station_index; } for (i=0; inb_candidate_stations; i++) { + int freq_precission = modulation == AM ? 5 : 50; double delta = fabs(sdr->candidate_station[i]->frequency - freq); // Station already added, or we have 2 rather close stations - if (modulation == sdr->candidate_station[i]->modulation && delta < 10 && sdr->candidate_station[i] != candidate_station) { + if (modulation == sdr->candidate_station[i]->modulation && delta < freq_precission && sdr->candidate_station[i] != candidate_station) { nb_candidate_match++; } if (modulation != sdr->candidate_station[i]->modulation && delta < (bandwidth + sdr->candidate_station[i]->bandwidth)/2.1) -- 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".