mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Set up pcm->info properly
Set up pcm->info properly for ioplug according to the avaialbe callbacks.
This commit is contained in:
parent
3092edabf2
commit
e76bbd74d7
1 changed files with 21 additions and 0 deletions
|
|
@ -237,6 +237,7 @@ static int snd_pcm_ioplug_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
{
|
||||
int change = 0, change1, change2, err;
|
||||
ioplug_priv_t *io = pcm->private_data;
|
||||
struct snd_ext_parm *p;
|
||||
int i;
|
||||
|
||||
/* access, format */
|
||||
|
|
@ -331,6 +332,26 @@ static int snd_pcm_ioplug_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
return err;
|
||||
}
|
||||
|
||||
params->info = SND_PCM_INFO_BLOCK_TRANSFER;
|
||||
p = &io->params[SND_PCM_IOPLUG_HW_ACCESS];
|
||||
if (p->active) {
|
||||
for (i = 0; i < p->num_list; i++)
|
||||
switch (p->list[i]) {
|
||||
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
||||
case SND_PCM_ACCESS_RW_INTERLEAVED:
|
||||
params->info |= SND_PCM_INFO_INTERLEAVED;
|
||||
break;
|
||||
case SND_PCM_ACCESS_MMAP_NONINTERLEAVED:
|
||||
case SND_PCM_ACCESS_RW_NONINTERLEAVED:
|
||||
params->info |= SND_PCM_INFO_NONINTERLEAVED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (io->data->callback->pause)
|
||||
params->info |= SND_PCM_INFO_PAUSE;
|
||||
if (io->data->callback->resume)
|
||||
params->info |= SND_PCM_INFO_RESUME;
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "XXX\n");
|
||||
dump_parm(params);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue