mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
sign fixes
This commit is contained in:
parent
0d004acf8d
commit
341689606f
1 changed files with 7 additions and 13 deletions
|
|
@ -208,10 +208,10 @@ static inline snd_pcm_uframes_t snd_pcm_mmap_playback_avail(snd_pcm_t *pcm)
|
||||||
{
|
{
|
||||||
snd_pcm_sframes_t avail;
|
snd_pcm_sframes_t avail;
|
||||||
avail = *pcm->hw_ptr + pcm->buffer_size - *pcm->appl_ptr;
|
avail = *pcm->hw_ptr + pcm->buffer_size - *pcm->appl_ptr;
|
||||||
if (avail >= pcm->boundary)
|
if (avail < 0)
|
||||||
avail -= pcm->boundary;
|
|
||||||
else if (avail < 0)
|
|
||||||
avail += pcm->boundary;
|
avail += pcm->boundary;
|
||||||
|
else if ((snd_pcm_uframes_t) avail >= pcm->boundary)
|
||||||
|
avail -= pcm->boundary;
|
||||||
return avail;
|
return avail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,16 +226,10 @@ static inline snd_pcm_uframes_t snd_pcm_mmap_capture_avail(snd_pcm_t *pcm)
|
||||||
|
|
||||||
static inline snd_pcm_uframes_t snd_pcm_mmap_avail(snd_pcm_t *pcm)
|
static inline snd_pcm_uframes_t snd_pcm_mmap_avail(snd_pcm_t *pcm)
|
||||||
{
|
{
|
||||||
snd_pcm_sframes_t avail;
|
if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
|
||||||
avail = *pcm->hw_ptr - *pcm->appl_ptr;
|
return snd_pcm_mmap_playback_avail(pcm);
|
||||||
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
|
else
|
||||||
avail += pcm->buffer_size;
|
return snd_pcm_mmap_capture_avail(pcm);
|
||||||
if (avail >= pcm->boundary)
|
|
||||||
avail -= pcm->boundary;
|
|
||||||
}
|
|
||||||
if (avail < 0)
|
|
||||||
avail += pcm->boundary;
|
|
||||||
return avail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline snd_pcm_sframes_t snd_pcm_mmap_playback_hw_avail(snd_pcm_t *pcm)
|
static inline snd_pcm_sframes_t snd_pcm_mmap_playback_hw_avail(snd_pcm_t *pcm)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue