Skip to content

Commit

Permalink
Fix RadioText error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
kkonradpl committed Oct 17, 2023
1 parent b2d0566 commit d097f39
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tuner-callbacks.c
Expand Up @@ -350,8 +350,9 @@ tuner_rds(guint *data,
if (rt[i] == 0x0D)
{
/* End of the RadioText message */
if ((i <= 1 && (errors&15) == 0) ||
(i >= 2 && (errors&51) == 0))
if (!err[RDS_BLOCK_B] &&
((i <= 1 && !err[RDS_BLOCK_C]) ||
(i >= 2 && !err[RDS_BLOCK_D])))
{
tuner.rds_rt[rt_flag][pos] = 0;
changed = TRUE;
Expand All @@ -361,8 +362,8 @@ tuner_rds(guint *data,
rt[i] < 127)
{
/* Only ASCII printable characters */
if ((i <= 1 && ((errors & 12) >> 2) <= conf.rds_rt_data_error) ||
(i >= 2 && ((errors & 48) >> 4) <= conf.rds_rt_data_error))
if ((i <= 1 && err[RDS_BLOCK_C] <= conf.rds_rt_data_error) ||
(i >= 2 && err[RDS_BLOCK_D] <= conf.rds_rt_data_error))
{
tuner.rds_rt[rt_flag][pos] = rt[i];
changed = TRUE;
Expand Down

0 comments on commit d097f39

Please sign in to comment.