From: Takashi Iwai Date: Tue, 20 Jun 2017 10:39:23 +0000 (+0200) Subject: pcm: hw: Remove superfluous call of snd_pcm_set_appl_ptr() X-Git-Tag: v1.1.5~40 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=987788dbfe65ae7811868654ba11c05b4582955f;p=alsa-lib.git pcm: hw: Remove superfluous call of snd_pcm_set_appl_ptr() There is a call of snd_pcm_set_appl_ptr() in snd_pcm_hw_hw_params() only for the capture direction. This must be a leftover from the ancient code. Although it's harmless for now, it's superfluous and confusing. Let's kill it. Reviewed-by: Takashi Sakamoto Tested-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c index de6fd1af..a648d12c 100644 --- a/src/pcm/pcm_hw.c +++ b/src/pcm/pcm_hw.c @@ -329,14 +329,7 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params) params->info &= ~0xf0000000; if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY) params->info |= SND_PCM_INFO_MONOTONIC; - err = sync_ptr(hw, 0); - if (err < 0) - return err; - if (pcm->stream == SND_PCM_STREAM_CAPTURE) { - snd_pcm_set_appl_ptr(pcm, &hw->mmap_control->appl_ptr, hw->fd, - SNDRV_PCM_MMAP_OFFSET_CONTROL); - } - return 0; + return sync_ptr(hw, 0); } static void snd_pcm_hw_close_timer(snd_pcm_hw_t *hw)