summaryrefslogtreecommitdiff
path: root/src/pcm/pcm_direct.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-01-18 13:42:51 +0100
committerTakashi Iwai <tiwai@suse.de>2008-01-18 13:42:51 +0100
commit35d4f9b8d702d027e74573bdeca5fc5e3e2efff8 (patch)
tree5707e2142edd740119ba6a8fadbec17d3bc508d3 /src/pcm/pcm_direct.c
parent91fc64cefb427bce0ac49f7acd2f3cf2d68ebb4b (diff)
downloadalsa-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.c6
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,