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 D90DF45A54 for ; Wed, 12 Jul 2023 23:37:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A929B68C60A; Thu, 13 Jul 2023 02:37:15 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F8F168C301 for ; Thu, 13 Jul 2023 02:37:09 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 79B1C20003 for ; Wed, 12 Jul 2023 23:37:08 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 13 Jul 2023 01:36:54 +0200 Message-Id: <20230712233706.449054-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230712233706.449054-1-michael@niedermayer.cc> References: <20230712233706.449054-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 02/14] avradio/sdr: Factor demodulate_all_fm out 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: This is cleaner Signed-off-by: Michael Niedermayer --- libavradio/sdr.h | 1 + libavradio/sdrdemux.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavradio/sdr.h b/libavradio/sdr.h index 6c4647823e..29ac4a2963 100644 --- a/libavradio/sdr.h +++ b/libavradio/sdr.h @@ -130,6 +130,7 @@ typedef struct SDRContext { int width, height; int single_ch_audio_st_index; int waterfall_st_index; + int demodulate_all_fm; int64_t freq; int64_t min_freq; int64_t max_freq; diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index e93cf4dd98..2103feaca8 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -1439,6 +1439,7 @@ int ff_sdr_common_init(AVFormatContext *s) st->codecpar->height = sdr->height; avpriv_set_pts_info(st, 64, 1, (48000/128) << FREQ_BITS); sdr->waterfall_st_index = st->index; + sdr->demodulate_all_fm = 1; } else sdr->waterfall_st_index = -1; @@ -1679,7 +1680,7 @@ process_next_block: } } - if (sdr->width > 1) { + if (sdr->demodulate_all_fm) { Station *station_list[1000]; 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; i