changelog shortlog tags manifest raw

changeset: Fix hwptr update in rate plugin

changeset 2149: 8c310c3277b7
parent 2148:402a902f18a8
child 2150:9e7cbb83d715
author: tiwai
date: Wed May 03 19:18:28 2006 +0200 (4 years ago)
files: src/pcm/pcm_rate.c
description: 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.
--- a/src/pcm/pcm_rate.c	Tue May 02 17:48:47 2006 +0200
+++ b/src/pcm/pcm_rate.c	Wed May 03 19:18:28 2006 +0200
@@ -603,7 +603,7 @@ static inline void snd_pcm_rate_sync_hwp
 	 */
 	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,
 		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);