perex 37d715
From 0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6 Mon Sep 17 00:00:00 2001
perex 37d715
From: Lennart Poettering <mznyfn@0pointer.de>
perex 37d715
Date: Fri, 18 Jul 2008 21:21:23 +0200
perex 37d715
Subject: [PATCH] clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
perex 37d715
perex 37d715
The clamping of the input parameter in snd_pcm_rewind()/_forward() is
perex 37d715
in the wrong direction.
perex 37d715
perex 37d715
Signed-off-by: Lennart Poettering <lennart@poettering.net>
perex 37d715
Signed-off-by: Takashi Iwai <tiwai@suse.de>
perex 37d715
---
perex 37d715
 src/pcm/pcm_plugin.c |    4 ++--
perex 37d715
 1 files changed, 2 insertions(+), 2 deletions(-)
perex 37d715
perex 37d715
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
perex 37d715
index c73a02b..c199d8d 100644
perex 37d715
--- a/src/pcm/pcm_plugin.c
perex 37d715
+++ b/src/pcm/pcm_plugin.c
perex 37d715
@@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
perex 37d715
 	snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
perex 37d715
 	snd_pcm_sframes_t sframes;
perex 37d715
 
perex 37d715
-	if ((snd_pcm_uframes_t)n > frames)
perex 37d715
+	if ((snd_pcm_uframes_t)n < frames)
perex 37d715
 		frames = n;
perex 37d715
 	if (frames == 0)
perex 37d715
 		return 0;
perex 37d715
@@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
perex 37d715
 	snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
perex 37d715
 	snd_pcm_uframes_t sframes;
perex 37d715
 
perex 37d715
-	if ((snd_pcm_uframes_t)n > frames)
perex 37d715
+	if ((snd_pcm_uframes_t)n < frames)
perex 37d715
 		frames = n;
perex 37d715
 	if (frames == 0)
perex 37d715
 		return 0;
perex 37d715
-- 
perex 37d715
1.5.5.1
perex 37d715