1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

BFM Demod: fixed RDS text clearscreen. Fixes #1101

This commit is contained in:
f4exb 2022-01-12 08:43:20 +01:00
parent 180d554812
commit 1a977c4ce2
2 changed files with 7 additions and 9 deletions

View File

@ -262,7 +262,6 @@ void RDSParser::clearUpdateFlags()
m_g14_updated = false;
m_g14_data_available = false;
m_g15_updated = false;
radiotext_AB_flag = false;
debug = false;
log = false;
}
@ -697,16 +696,16 @@ void RDSParser::decode_type2(unsigned int *group, bool B)
m_g2_updated = true;
m_g2_count++;
bool radiotext_AB_flag = ((group[1] >> 4) & 0x01);
// when the A/B flag is toggled, flush your current radiotext
if (radiotext_AB_flag != ((group[1] >> 4) & 0x01))
// when the flag goes from B to A (false -> true), flush your current radiotext
if (!m_radiotext_AB_flag && radiotext_AB_flag)
{
// qDebug("RDSParser::decode_type2: ---------");
std::memset(m_g2_radiotext, ' ', sizeof(m_g2_radiotext));
m_g2_radiotext[sizeof(m_g2_radiotext) - 1] = '\0';
}
radiotext_AB_flag = (group[1] >> 4) & 0x01;
if (!B)
{
m_g2_radiotext[text_segment_address_code * 4 ] = (group[2] >> 8) & 0xff;
@ -720,9 +719,8 @@ void RDSParser::decode_type2(unsigned int *group, bool B)
m_g2_radiotext[text_segment_address_code * 2 + 1] = group[3] & 0xff;
}
/*
qDebug() << "RDSParser::decode_type2: " << "Radio Text " << (radiotext_AB_flag ? 'B' : 'A')
<< ": " << std::string(m_g2_radiotext, sizeof(m_g2_radiotext)).c_str();*/
// qDebug("RDSParser::decode_type2: %x Radio Text %s: '%s'", group[1], radiotext_AB_flag ? "A" : "B", m_g2_radiotext);
m_radiotext_AB_flag = radiotext_AB_flag;
}
void RDSParser::decode_type3(unsigned int *group, bool B)

View File

@ -193,7 +193,7 @@ private:
unsigned char pi_country_identification;
unsigned char pi_program_reference_number;
bool radiotext_AB_flag;
bool m_radiotext_AB_flag;
bool debug;
bool log;