clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction

The clamping of the input parameter in snd_pcm_rewind()/_forward() is
in the wrong direction.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Lennart Poettering 2008-07-18 21:21:23 +02:00 committed by Takashi Iwai
parent f78af4ab04
commit 0fbfe2d8d6

View file

@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
snd_pcm_sframes_t sframes;
if ((snd_pcm_uframes_t)n > frames)
if ((snd_pcm_uframes_t)n < frames)
frames = n;
if (frames == 0)
return 0;
@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
snd_pcm_uframes_t sframes;
if ((snd_pcm_uframes_t)n > frames)
if ((snd_pcm_uframes_t)n < frames)
frames = n;
if (frames == 0)
return 0;