diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-01-18 13:42:51 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-01-18 13:42:51 +0100 |
commit | 35d4f9b8d702d027e74573bdeca5fc5e3e2efff8 (patch) | |
tree | 5707e2142edd740119ba6a8fadbec17d3bc508d3 /src/pcm/pcm_direct.c | |
parent | 91fc64cefb427bce0ac49f7acd2f3cf2d68ebb4b (diff) | |
download | alsa-lib-35d4f9b8d702d027e74573bdeca5fc5e3e2efff8.tar.gz |
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.
Diffstat (limited to 'src/pcm/pcm_direct.c')
-rw-r--r-- | src/pcm/pcm_direct.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index 75d540d4..a884b120 100644 --- a/src/pcm/pcm_direct.c +++ b/src/pcm/pcm_direct.c @@ -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, |