OSDN Git Service

Fix hwptr update in rate plugin
authorTakashi Iwai <tiwai@suse.de>
Wed, 3 May 2006 17:18:28 +0000 (19:18 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 3 May 2006 17:18:28 +0000 (19:18 +0200)
Fixed the update of hwptr in rate plugin.
This caused bad sounds on rate expansion and invalid memory access.

src/pcm/pcm_rate.c

index 0403e52..bbf0df6 100644 (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);