mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-21 00:05:30 +00:00
(tinyalsa) Buildfix
This commit is contained in:
parent
b74b0ceed5
commit
97063701f8
@ -1060,7 +1060,7 @@ static int pcm_set_config(struct pcm *pcm, const struct pcm_config *config)
|
||||
memset(&sparams, 0, sizeof(sparams));
|
||||
sparams.tstamp_mode = SNDRV_PCM_TSTAMP_ENABLE;
|
||||
sparams.period_step = 1;
|
||||
sparams.avail_min = 1;
|
||||
sparams.avail_min = 1;
|
||||
|
||||
if (!config->start_threshold)
|
||||
{
|
||||
@ -1126,15 +1126,17 @@ static int pcm_hw_mmap_status(struct pcm *pcm)
|
||||
|
||||
page_size = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
pcm->mmap_status = (snd_pcm_mmap_status*)mmap(NULL, page_size, PROT_READ, MAP_FILE | MAP_SHARED,
|
||||
pcm->fd, SNDRV_PCM_MMAP_OFFSET_STATUS);
|
||||
pcm->mmap_status = (struct snd_pcm_mmap_status*)
|
||||
mmap(NULL, page_size, PROT_READ, MAP_FILE | MAP_SHARED,
|
||||
pcm->fd, SNDRV_PCM_MMAP_OFFSET_STATUS);
|
||||
if (pcm->mmap_status == MAP_FAILED)
|
||||
pcm->mmap_status = NULL;
|
||||
if (!pcm->mmap_status)
|
||||
goto mmap_error;
|
||||
|
||||
pcm->mmap_control = (snd_pcm_mmap_control*)mmap(NULL, page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_FILE | MAP_SHARED, pcm->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL);
|
||||
pcm->mmap_control = (struct snd_pcm_mmap_control*)
|
||||
mmap(NULL, page_size, PROT_READ | PROT_WRITE,
|
||||
MAP_FILE | MAP_SHARED, pcm->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL);
|
||||
if (pcm->mmap_control == MAP_FAILED)
|
||||
pcm->mmap_control = NULL;
|
||||
if (!pcm->mmap_control)
|
||||
@ -1149,7 +1151,8 @@ static int pcm_hw_mmap_status(struct pcm *pcm)
|
||||
|
||||
mmap_error:
|
||||
|
||||
pcm->sync_ptr = (snd_pcm_sync_ptr*)calloc(1, sizeof(*pcm->sync_ptr));
|
||||
pcm->sync_ptr = (struct snd_pcm_sync_ptr*)
|
||||
calloc(1, sizeof(*pcm->sync_ptr));
|
||||
if (!pcm->sync_ptr)
|
||||
return -ENOMEM;
|
||||
pcm->mmap_status = &pcm->sync_ptr->s.status;
|
||||
@ -1815,7 +1818,8 @@ static struct pcm *pcm_open(unsigned int card, unsigned int device,
|
||||
goto fail_close;
|
||||
|
||||
rc = pcm_hw_mmap_status(pcm);
|
||||
if (rc < 0) {
|
||||
if (rc < 0)
|
||||
{
|
||||
oops(pcm, rc, "mmap status failed");
|
||||
goto fail;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user