]> git.alsa-project.org Git - alsa-lib.git/commitdiff
clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
authorLennart Poettering <mznyfn@0pointer.de>
Fri, 18 Jul 2008 19:21:23 +0000 (21:21 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sun, 20 Jul 2008 15:25:53 +0000 (17:25 +0200)
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>
src/pcm/pcm_plugin.c

index c73a02b21f2f0a0e55365a7d9cffb7ea91d1e906..c199d8df71def0e4f456ed061bd9e3895a6deb57 100644 (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;