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 8A1C845A54 for ; Wed, 12 Jul 2023 23:38:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B808D68C654; Thu, 13 Jul 2023 02:37:20 +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 DC2E568C624 for ; Thu, 13 Jul 2023 02:37:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4DAC560004 for ; Wed, 12 Jul 2023 23:37:13 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 13 Jul 2023 01:36:58 +0200 Message-Id: <20230712233706.449054-6-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 06/14] avradio/rds: Implement clearing radio text 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/rds.c | 9 +++++++-- libavradio/sdr.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libavradio/rds.c b/libavradio/rds.c index 55b24a0d9e..e121c9db8e 100644 --- a/libavradio/rds.c +++ b/libavradio/rds.c @@ -130,14 +130,19 @@ static int decode_rds_group(SDRContext *sdr, Station *station, uint16_t group[4] case 0: AV_WB16(station->name + 2*(group[1]&3), group[3]); break; - case 2: + case 2:{ + int new_ab_flag = group[1] & 16; + if (new_ab_flag != station->rt_ab_flag) { + memset(station->radiotext, 0, sizeof(station->radiotext)); + station->rt_ab_flag = new_ab_flag; + } if (b) { AV_WB16(station->radiotext + 2*(group[1]&15) , group[3]); } else { AV_WB16(station->radiotext + 4*(group[1]&15) , group[2]); AV_WB16(station->radiotext + 4*(group[1]&15) + 2, group[3]); } - break; + break;} case 10: if (b==0) { AV_WB16(station->programm_type_name + 4*(group[1]&1) , group[2]); diff --git a/libavradio/sdr.h b/libavradio/sdr.h index 29ac4a2963..4b3e14da02 100644 --- a/libavradio/sdr.h +++ b/libavradio/sdr.h @@ -75,6 +75,8 @@ typedef struct Station { char radiotext[65]; char programm_type_name[9]; int program_id[2]; + uint8_t rt_ab_flag; + enum Modulation modulation; double frequency; int nb_frequency; ///< number of detections which are used to compute the frequency -- 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".