DO NOT USE MALLOC DO NOT USE MALLOC DO NOT USE MALLOC DO NOT USE MALLOC DO NOT USE MALLOC DO NOT USE MALLOC DO NOT USE MALLOC

This commit is contained in:
2025-06-21 14:25:39 +02:00
parent dbd5aa7180
commit 102067881d
2 changed files with 2 additions and 9 deletions
-7
View File
@@ -29,13 +29,6 @@ int read_PulseInputDevice(PulseInputDevice* dev, void* buffer, size_t size) {
return error; return error;
} }
int read_PulseInputDevicef(PulseInputDevice* dev, void* buffer, size_t size) {
if (!dev->initialized) return -1;
int error = 0;
if(pa_simple_read(dev->dev, buffer, size, &error) == 0) return 0;
return error;
}
void free_PulseInputDevice(PulseInputDevice* dev) { void free_PulseInputDevice(PulseInputDevice* dev) {
#ifdef PULSE_DEBUG #ifdef PULSE_DEBUG
debug_printf("Freeing PulseInputDevice with app_name: %s, stream_name: %s, device: %s\n", dev->app_name, dev->stream_name, dev->device); debug_printf("Freeing PulseInputDevice with app_name: %s, stream_name: %s, device: %s\n", dev->app_name, dev->stream_name, dev->device);
+2 -2
View File
@@ -370,7 +370,7 @@ int main(int argc, char **argv) {
float audio_stereo_input[BUFFER_SIZE*2]; // Stereo float audio_stereo_input[BUFFER_SIZE*2]; // Stereo
float *rds_in = malloc(sizeof(float) * BUFFER_SIZE * rds_streams); float *rds_in = malloc(sizeof(float) * BUFFER_SIZE * rds_streams);
memset(&rds_in, 0, sizeof(rds_in)); memset(rds_in, 0, sizeof(float) * BUFFER_SIZE * rds_streams);
float mpx_in[BUFFER_SIZE] = {0}; float mpx_in[BUFFER_SIZE] = {0};
float sca_in[BUFFER_SIZE] = {0}; float sca_in[BUFFER_SIZE] = {0};
@@ -392,7 +392,7 @@ int main(int argc, char **argv) {
} }
} }
if(rds_on) { if(rds_on) {
if((pulse_error = read_PulseInputDevice(&rds_device, rds_in, sizeof(rds_in)))) { if((pulse_error = read_PulseInputDevice(&rds_device, rds_in, sizeof(float) * BUFFER_SIZE * rds_streams);)) {
if(pulse_error == -1) fprintf(stderr, "RDS95 PulseInputDevice reported as uninitialized."); if(pulse_error == -1) fprintf(stderr, "RDS95 PulseInputDevice reported as uninitialized.");
else fprintf(stderr, "Error reading from RDS95 device: %s\n", pa_strerror(pulse_error)); else fprintf(stderr, "Error reading from RDS95 device: %s\n", pa_strerror(pulse_error));
to_run = 0; to_run = 0;