mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 19:23:51 +01:00
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:
@@ -29,13 +29,6 @@ int read_PulseInputDevice(PulseInputDevice* dev, void* buffer, size_t size) {
|
||||
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) {
|
||||
#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);
|
||||
|
||||
@@ -370,7 +370,7 @@ int main(int argc, char **argv) {
|
||||
float audio_stereo_input[BUFFER_SIZE*2]; // Stereo
|
||||
|
||||
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 sca_in[BUFFER_SIZE] = {0};
|
||||
@@ -392,7 +392,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
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.");
|
||||
else fprintf(stderr, "Error reading from RDS95 device: %s\n", pa_strerror(pulse_error));
|
||||
to_run = 0;
|
||||
|
||||
Reference in New Issue
Block a user