lol wine
[gentoo-diskmaster-overlay.git] / media-libs / alsa-lib / files / alsa-lib-1.0.17-clamp-input.patch
blob4ffc2a9d52674026eafab391d2a43acc7af75e1c
1 From: Lennart Poettering <mznyfn@0pointer.de>
2 Date: Fri, 18 Jul 2008 19:21:23 +0000 (+0200)
3 Subject: clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
4 X-Git-Url: http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff_plain;h=0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6;hp=f78af4ab0412052aabb74c9122a8d8f3ab6d45e6
6 clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
8 The clamping of the input parameter in snd_pcm_rewind()/_forward() is
9 in the wrong direction.
11 Signed-off-by: Lennart Poettering <lennart@poettering.net>
12 Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 ---
15 diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
16 index c73a02b..c199d8d 100644
17 --- a/src/pcm/pcm_plugin.c
18 +++ b/src/pcm/pcm_plugin.c
19 @@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
20 snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
21 snd_pcm_sframes_t sframes;
23 - if ((snd_pcm_uframes_t)n > frames)
24 + if ((snd_pcm_uframes_t)n < frames)
25 frames = n;
26 if (frames == 0)
27 return 0;
28 @@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
29 snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
30 snd_pcm_uframes_t sframes;
32 - if ((snd_pcm_uframes_t)n > frames)
33 + if ((snd_pcm_uframes_t)n < frames)
34 frames = n;
35 if (frames == 0)
36 return 0;