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 04441462E7 for ; Fri, 14 Jul 2023 18:03:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4B33B68C61B; Fri, 14 Jul 2023 21:03:49 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 87A1E68C2D7 for ; Fri, 14 Jul 2023 21:03:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9BC47240004 for ; Fri, 14 Jul 2023 18:03:42 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 14 Jul 2023 20:03:40 +0200 Message-Id: <20230714180341.2186605-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/2] avradio/sdrdemux: avoid repeated litteral number 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 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index d40b92dd24..041775730e 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -57,6 +57,8 @@ #include "libavutil/lfg.h" #endif +#define MAX_STATIONS 1000 // Maximum stations vissible at the same time + #define AM_FREQ_TOLERANCE 5 #define FM_FREQ_TOLERANCE 500 @@ -185,7 +187,7 @@ static int create_station(SDRContext *sdr, Station *candidate_station) { int conflict = INT_MAX; int nb_candidate_conflict = 0; int nb_candidate_match = 0; - Station *station_list[1000]; + Station *station_list[MAX_STATIONS]; if (candidate_station->in_station_list) @@ -287,7 +289,7 @@ static int create_station(SDRContext *sdr, Station *candidate_station) { static void create_stations(SDRContext *sdr) { - Station *station_list[1000]; + Station *station_list[MAX_STATIONS]; int nb_stations; if (!sdr->block_center_freq) @@ -330,7 +332,7 @@ static void *tree_remove(struct AVTreeNode **rootp, void *key, */ static void decay_stations(SDRContext *sdr) { - Station *station_list[1000]; + Station *station_list[MAX_STATIONS]; int nb_stations = ff_sdr_find_stations(sdr, sdr->block_center_freq, sdr->bandwidth*0.5, station_list, FF_ARRAY_ELEMS(station_list)); for (int i=0; iblock_center_freq, sdr->sdr_sample_rate*0.5, station_list, FF_ARRAY_ELEMS(station_list)); if (sst->station) { @@ -1740,7 +1742,7 @@ process_next_block: } if (sdr->demodulate_all_fm) { - Station *station_list[1000]; + Station *station_list[MAX_STATIONS]; int nb_stations = ff_sdr_find_stations(sdr, sdr->block_center_freq, sdr->sdr_sample_rate*0.5, station_list, FF_ARRAY_ELEMS(station_list)); for (int i= 0; iblock_center_freq) { - Station *station_list[1000]; + Station *station_list[MAX_STATIONS]; int nb_stations; if (sdr->skip_probe-- <= 0) { //Probing takes a bit of time, lets not do it every time -- 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".