From patchwork Fri Jul 7 17:22:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42519 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1e:b0:12b:9ae3:586d with SMTP id c30csp7450270pzh; Fri, 7 Jul 2023 10:23:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjN8MMxypugtTov/drPPbapkw75kR8DDSP4h6aVj/sDVXp1dXKOTD9GMkiNzFNztBT00a3 X-Received: by 2002:a17:907:d30d:b0:965:6075:d100 with SMTP id vg13-20020a170907d30d00b009656075d100mr5428487ejc.39.1688750621466; Fri, 07 Jul 2023 10:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688750621; cv=none; d=google.com; s=arc-20160816; b=jXn+zrA0GDtV6WtOl5pvYNrzEpIlsAncizakZpw4A1AgFqK4O2VtzjNswLkopYB4DQ muX4ymLJ//Vuzcmu2EK4WPykmDlpmrGbsrxViHpegqXKX3iyF4nW/fzG9TVtRPOfwbPI K1kI01j6SabpqIuxpTFUawrRnbZO96+R8N3vRYDfJZ4Jg2kFQ1wM4fYSKQRyTX9EkBEn 1HSVkP4aQYzr9sU3cOyGrOUdSAI5JSdIC2UCCG9yLZBAhDXI2MJhjvcdx9iw7/UsgVr+ qz7v46ijDLbjkWd5OYoccBSnnFDQTmWVVRjynmk/oiVWbYT5b2wFgaiRcOxtcUi8d/ik qA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=JL8dChqP1NGKS9G2anpEBvD0TR0ynRyxVJgHZF/zUpQ=; fh=YYwLYmpaV0Fpw/rxmSKNRLS2XzDkAlGbHATiKOPtZrY=; b=Ns/yOdd0+bSnmHCTq7Eiljm3EtflcjRuXL9YPza3/es/O6vbLcqm5q4WjIJkEU45Cx o+9I7pKTgKt00memK+U6TPvmp4qc/jAJ7y8heBHYg7VLePp0r1q5k8l3R8Xyr6WPIeRJ xBILVxh9BqTcryypSOaiUT7vu7u6/u6KFBfR5P2xGY0olBrHx9TL+E63KTczu7UEvpHR yqS/hIZ2o3zACQWkE6Dgq7SziWSxign115naU5LzxNmmlPnCZkTNsObJlzOLH2ALvj7+ 13zwsA84MFmS06NcmyfHkMEWHNaaVrfMLZLUfAeqnJ2nXYgczxhR78fVTeySUexGtYES ulvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k4-20020a17090627c400b00986b1c0b4d2si2602050ejc.595.2023.07.07.10.23.41; Fri, 07 Jul 2023 10:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4BBB468C827; Fri, 7 Jul 2023 20:22:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2141368C81A for ; Fri, 7 Jul 2023 20:22:35 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id 841681BF203 for ; Fri, 7 Jul 2023 17:22:34 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 7 Jul 2023 19:22:23 +0200 Message-Id: <20230707172224.2368067-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230707172224.2368067-1-michael@niedermayer.cc> References: <20230707172224.2368067-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/9] avradio/sdrdemux: increase the FM station frequency tolerance 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1tfVW+le6Sfw The current FM station probing code is quite inaccurate with the detected frequency. Doing better requires some extra computations, maybe this is good enough Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index 1fc528317c..4c1ec7b51c 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -248,7 +248,7 @@ static int create_station(SDRContext *sdr, Station *candidate_station) { nb_candidate_match += candidate_station->nb_frequency - 1; for (i=0; ifrequency - freq); @@ -383,7 +383,7 @@ static int create_candidate_station(SDRContext *sdr, enum Modulation modulation, void *tmp; struct AVTreeNode *next = NULL; Station *station_list[1000]; - double snapdistance = modulation == AM ? 5 : 50; + double snapdistance = modulation == AM ? 5 : 500; int nb_stations = find_stations(sdr, freq, snapdistance, station_list, FF_ARRAY_ELEMS(station_list)); if (nb_stations) {