From ee123ac93ea59d11e7d3c48aed9cf88d1a5de431 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 22 Feb 2007 12:32:02 +0100 Subject: Fix wrong implementation of input/output_frames in samplerate plugin The libsamplerate rate plugin has wrong implementations of input_frames and output_frames callbacks. They have to be swapped. From: Jean-Marc Valin --- rate/rate_samplerate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rate/rate_samplerate.c b/rate/rate_samplerate.c index af5c9c0..d07e7ce 100644 --- a/rate/rate_samplerate.c +++ b/rate/rate_samplerate.c @@ -38,7 +38,7 @@ static snd_pcm_uframes_t input_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 snd_pcm_uframes_t output_frames(void *obj, snd_pcm_uframes_t frames) @@ -46,7 +46,7 @@ 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) -- cgit