mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
Code checking mmap() is back
This commit is contained in:
parent
2969cea162
commit
667f008cd4
1 changed files with 10 additions and 0 deletions
|
|
@ -196,6 +196,11 @@ static snd_pcm_sframes_t snd_pcm_surround_writei(snd_pcm_t *pcm, const void *buf
|
||||||
snd_pcm_surround_t *surr = pcm->private_data;
|
snd_pcm_surround_t *surr = pcm->private_data;
|
||||||
if (surr->pcms == 1)
|
if (surr->pcms == 1)
|
||||||
return snd_pcm_writei(surr->pcm[0], buffer, size);
|
return snd_pcm_writei(surr->pcm[0], buffer, size);
|
||||||
|
if (pcm->running_areas == NULL) {
|
||||||
|
int err;
|
||||||
|
if ((err = snd_pcm_mmap(pcm)) < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
return snd_pcm_mmap_writei(pcm, buffer, size);
|
return snd_pcm_mmap_writei(pcm, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,6 +226,11 @@ static snd_pcm_sframes_t snd_pcm_surround_readi(snd_pcm_t *pcm, void *buffer, sn
|
||||||
snd_pcm_surround_t *surr = pcm->private_data;
|
snd_pcm_surround_t *surr = pcm->private_data;
|
||||||
if (surr->pcms == 1)
|
if (surr->pcms == 1)
|
||||||
return snd_pcm_readi(surr->pcm[0], buffer, size);
|
return snd_pcm_readi(surr->pcm[0], buffer, size);
|
||||||
|
if (pcm->running_areas == NULL) {
|
||||||
|
int err;
|
||||||
|
if ((err = snd_pcm_mmap(pcm)) < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
return snd_pcm_mmap_readi(pcm, buffer, size);
|
return snd_pcm_mmap_readi(pcm, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue