diff --git a/src/rds.c b/src/rds.c index 007cb3a..570adc5 100644 --- a/src/rds.c +++ b/src/rds.c @@ -551,7 +551,7 @@ static void get_rds_group(RDSEncoder* enc, uint16_t *blocks, bool rds2) { if(rds2 && !enc->encoder_data.rds2_mode) blocks[0] = 0; // tunneling else if(rds2 && enc->encoder_data.rds2_mode) { // TODO: add rds2 only stuff - return; + goto group_coded; } blocks[1] = 0; blocks[2] = 0; diff --git a/src/rds95.c b/src/rds95.c index 29df3bb..fb0f83e 100644 --- a/src/rds95.c +++ b/src/rds95.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) { char control_pipe[51] = "\0"; - pa_simple *device; + pa_simple *rds1_device; #ifdef RDS2_DEVICE pa_simple *rds2_device = NULL; #endif @@ -102,18 +102,18 @@ int main(int argc, char **argv) { buffer.tlength = 8192; buffer.maxlength = 8192; - device = pa_simple_new( + rds1_device = pa_simple_new( NULL, "rds95", PA_STREAM_PLAYBACK, RDS_DEVICE, - "RDS Generator", + "RDS1 Generator", &format, NULL, &buffer, NULL ); - if (device == NULL) { + if (rds1_device == NULL) { fprintf(stderr, "Error: cannot open sound device.\n"); goto exit; } @@ -173,13 +173,13 @@ int main(int argc, char **argv) { #endif } - if (pa_simple_write(device, rds1_buffer, sizeof(rds1_buffer), &pulse_error) != 0) { + if (pa_simple_write(rds1_device, rds1_buffer, sizeof(rds1_buffer), &pulse_error) != 0) { fprintf(stderr, "Error: could not play audio. (%s : %d)\n", pa_strerror(pulse_error), pulse_error); break; } #ifdef RDS2_DEVICE if (pa_simple_write(rds2_device, rds2_buffer, sizeof(rds2_buffer), &pulse_error) != 0) { - fprintf(stderr, "Error: could not play audio. (%s : %d)\n", pa_strerror(pulse_error), pulse_error); + fprintf(stderr, "Error: could not play audio. RDS2 (%s : %d)\n", pa_strerror(pulse_error), pulse_error); break; } #endif @@ -192,7 +192,7 @@ exit: } pthread_attr_destroy(&attr); - pa_simple_free(device); + pa_simple_free(rds1_device); #ifdef RDS2_DEVICE pa_simple_free(rds2_device); #endif