Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDS: fix flags decoding #1361

Merged
merged 1 commit into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/dsp/rds/parser_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void parser_impl::reset() {
mono_stereo = false;
artificial_head = false;
compressed = false;
static_pty = false;
dynamic_pty = false;
}

/* type 0 = PI
Expand Down Expand Up @@ -103,16 +103,16 @@ void parser_impl::decode_type0(unsigned int *group, bool B) {
/* see page 41, table 9 of the standard */
switch (segment_address) {
case 0:
mono_stereo=decoder_control_bit;
dynamic_pty=decoder_control_bit;
break;
case 1:
artificial_head=decoder_control_bit;
compressed=decoder_control_bit;
break;
case 2:
compressed=decoder_control_bit;
artificial_head=decoder_control_bit;
break;
case 3:
static_pty=decoder_control_bit;
mono_stereo=decoder_control_bit;
break;
default:
break;
Expand All @@ -123,7 +123,7 @@ void parser_impl::decode_type0(unsigned int *group, bool B) {
flagstring[3] = mono_stereo ? '1' : '0';
flagstring[4] = artificial_head ? '1' : '0';
flagstring[5] = compressed ? '1' : '0';
flagstring[6] = static_pty ? '1' : '0';
flagstring[6] = dynamic_pty ? '1' : '0';
static std::string af_string;

if(!B) { // type 0A
Expand Down
2 changes: 1 addition & 1 deletion src/dsp/rds/parser_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class parser_impl : public parser
bool mono_stereo;
bool artificial_head;
bool compressed;
bool static_pty;
bool dynamic_pty;
bool log;
bool debug;
unsigned char pty_locale;
Expand Down
6 changes: 3 additions & 3 deletions src/qtgui/dockrds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ void DockRDS::updateRDS(QString text, int type)
if (str.at(1) == '1') out.append("TA ");
if (str.at(2) == '0') out.append("Speech ");
if (str.at(2) == '1') out.append("Music ");
if (str.at(3) == '0') out.append("Stereo ");
if (str.at(3) == '1') out.append("Mono ");
if (str.at(3) == '1') out.append("Stereo ");
if (str.at(3) == '0') out.append("Mono ");
if (str.at(4) == '1') out.append("AH ");
if (str.at(5) == '1') out.append("CMP ");
if (str.at(6) == '1') out.append("stPTY ");
if (str.at(6) == '0') out.append("stPTY ");
ui->flags->setText(QString::fromStdString(out));
break;
case 4:
Expand Down
Loading