Fix hwptr update in rate plugin

Fixed the update of hwptr in rate plugin.
This caused bad sounds on rate expansion and invalid memory access.
This commit is contained in:
Takashi Iwai 2006-05-03 19:18:28 +02:00
parent ae363f57be
commit f9e0c56c46

View file

@ -603,7 +603,7 @@ static inline void snd_pcm_rate_sync_hwptr(snd_pcm_t *pcm)
*/
rate->hw_ptr =
(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
rate->ops.output_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
}
static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
@ -1437,9 +1437,6 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
return -EINVAL;
}
if (! type) {
}
err = snd_pcm_slave_conf(root, slave, &sconf, 2,
SND_PCM_HW_PARAM_FORMAT, 0, &sformat,
SND_PCM_HW_PARAM_RATE, SCONF_MANDATORY, &srate);