0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00

try to fix

This commit is contained in:
2025-03-22 19:38:10 +01:00
parent bc243afdb5
commit 20f36a2d10
2 changed files with 8 additions and 8 deletions

View File

@@ -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 if(rds2 && !enc->encoder_data.rds2_mode) blocks[0] = 0; // tunneling
else if(rds2 && enc->encoder_data.rds2_mode) { else if(rds2 && enc->encoder_data.rds2_mode) {
// TODO: add rds2 only stuff // TODO: add rds2 only stuff
return; goto group_coded;
} }
blocks[1] = 0; blocks[1] = 0;
blocks[2] = 0; blocks[2] = 0;

View File

@@ -55,7 +55,7 @@ int main(int argc, char **argv) {
char control_pipe[51] = "\0"; char control_pipe[51] = "\0";
pa_simple *device; pa_simple *rds1_device;
#ifdef RDS2_DEVICE #ifdef RDS2_DEVICE
pa_simple *rds2_device = NULL; pa_simple *rds2_device = NULL;
#endif #endif
@@ -102,18 +102,18 @@ int main(int argc, char **argv) {
buffer.tlength = 8192; buffer.tlength = 8192;
buffer.maxlength = 8192; buffer.maxlength = 8192;
device = pa_simple_new( rds1_device = pa_simple_new(
NULL, NULL,
"rds95", "rds95",
PA_STREAM_PLAYBACK, PA_STREAM_PLAYBACK,
RDS_DEVICE, RDS_DEVICE,
"RDS Generator", "RDS1 Generator",
&format, &format,
NULL, NULL,
&buffer, &buffer,
NULL NULL
); );
if (device == NULL) { if (rds1_device == NULL) {
fprintf(stderr, "Error: cannot open sound device.\n"); fprintf(stderr, "Error: cannot open sound device.\n");
goto exit; goto exit;
} }
@@ -173,13 +173,13 @@ int main(int argc, char **argv) {
#endif #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); fprintf(stderr, "Error: could not play audio. (%s : %d)\n", pa_strerror(pulse_error), pulse_error);
break; break;
} }
#ifdef RDS2_DEVICE #ifdef RDS2_DEVICE
if (pa_simple_write(rds2_device, rds2_buffer, sizeof(rds2_buffer), &pulse_error) != 0) { 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; break;
} }
#endif #endif
@@ -192,7 +192,7 @@ exit:
} }
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
pa_simple_free(device); pa_simple_free(rds1_device);
#ifdef RDS2_DEVICE #ifdef RDS2_DEVICE
pa_simple_free(rds2_device); pa_simple_free(rds2_device);
#endif #endif