dmix - Enable auto format detection as default

The direct plugins have the automatic format-detection feature but it
wasn't enabled properly in the interface.  Now you can pass the format
"unchanged" to make the plugin detect a proper format.

This will change the default format of some drivers, such as, HD-audio.
This commit is contained in:
Takashi Iwai 2008-01-18 13:42:51 +01:00
parent 91fc64cefb
commit 35d4f9b8d7
3 changed files with 11 additions and 5 deletions

View file

@ -874,7 +874,11 @@ int snd_pcm_direct_initialize_slave(snd_pcm_direct_t *dmix, snd_pcm_t *spcm, str
return ret;
}
}
ret = snd_pcm_hw_params_set_format(spcm, hw_params, params->format);
if (params->format == SND_PCM_FORMAT_UNKNOWN)
ret = -EINVAL;
else
ret = snd_pcm_hw_params_set_format(spcm, hw_params,
params->format);
if (ret < 0) {
static const snd_pcm_format_t dmix_formats[] = {
SND_PCM_FORMAT_S32,