mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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:
parent
f78af4ab04
commit
0fbfe2d8d6
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue