Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 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-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to