From d0be76a11d5cc6be321ba0d09f1d4861e3d9d691 Mon Sep 17 00:00:00 2001 From: Kuba <132459354+KubaPro010@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:34:31 +0100 Subject: [PATCH] bug fix, i thing (fun fact: did you know that computer bugs are named after actual bugs? ask chatgpt) --- src/pifmrds/fm_mpx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pifmrds/fm_mpx.c b/src/pifmrds/fm_mpx.c index e63024d..b80a688 100644 --- a/src/pifmrds/fm_mpx.c +++ b/src/pifmrds/fm_mpx.c @@ -201,6 +201,7 @@ int fm_mpx_open(char *filename, size_t len, int raw, double preemphasis, int raw // samples provided by this function are in 0..10: they need to be divided by // 10 after. int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, float compressor_attack, float compressor_max_gain_recip, int disablestereo, float gain, int enablecompressor, int rds_ct_enabled, float rds_volume, int paused, float pilot_volume, int generate_multiplex) { + audio_buffer = 0.0; //in order to avoild what i call "frame looping", so the exact same thing isnt played, if the audio stream is cut off int stereo_capable = (channels > 1) && (!disablestereo); //chatgpt if(!drds && generate_multiplex) get_rds_samples(mpx_buffer, length, stereo_capable, rds_ct_enabled, rds_volume); @@ -210,7 +211,7 @@ int fm_mpx_get_samples(float *mpx_buffer, int drds, float compressor_decay, floa if(audio_pos >= downsample_factor) { audio_pos -= downsample_factor; - if(audio_len <= channels ) { + if(audio_len <=channels ) { for(int j=0; j<2; j++) { // one retry audio_len = sf_read_float(inf, audio_buffer, length); if (audio_len < 0) {