mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Allow auto-config for dsnoop and dshare plugins
This commit is contained in:
parent
d902c124b4
commit
c1d06bda17
2 changed files with 8 additions and 2 deletions
|
|
@ -894,7 +894,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
bsize = psize = -1;
|
||||
params.periods = 3;
|
||||
err = snd_pcm_slave_conf(root, dopen.slave, &sconf, 8,
|
||||
SND_PCM_HW_PARAM_FORMAT, 0, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_FORMAT, SCONF_UNCHANGED, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_RATE, 0, ¶ms.rate,
|
||||
SND_PCM_HW_PARAM_CHANNELS, 0, ¶ms.channels,
|
||||
SND_PCM_HW_PARAM_PERIOD_TIME, 0, ¶ms.period_time,
|
||||
|
|
@ -909,6 +909,9 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
if (params.format == -2)
|
||||
params.format = SND_PCM_FORMAT_UNKNOWN;
|
||||
|
||||
params.period_size = psize;
|
||||
params.buffer_size = bsize;
|
||||
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
bsize = psize = -1;
|
||||
params.periods = 3;
|
||||
err = snd_pcm_slave_conf(root, dopen.slave, &sconf, 8,
|
||||
SND_PCM_HW_PARAM_FORMAT, 0, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_FORMAT, SCONF_UNCHANGED, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_RATE, 0, ¶ms.rate,
|
||||
SND_PCM_HW_PARAM_CHANNELS, 0, ¶ms.channels,
|
||||
SND_PCM_HW_PARAM_PERIOD_TIME, 0, ¶ms.period_time,
|
||||
|
|
@ -781,6 +781,9 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
if (params.format == -2)
|
||||
params.format = SND_PCM_FORMAT_UNKNOWN;
|
||||
|
||||
params.period_size = psize;
|
||||
params.buffer_size = bsize;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue