The libsamplerate rate plugin has wrong implementations of input_frames
and output_frames callbacks. They have to be swapped.
From: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
struct rate_src *rate = obj;
if (frames == 0)
return 0;
- return (snd_pcm_uframes_t)(frames * rate->ratio);
+ return (snd_pcm_uframes_t)(frames / rate->ratio);
}
static snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames)
struct rate_src *rate = obj;
if (frames == 0)
return 0;
- return (snd_pcm_uframes_t)(frames / rate->ratio);
+ return (snd_pcm_uframes_t)(frames * rate->ratio);
}
static void pcm_src_free(void *obj)