On record only devices, don't fail if we don't have a play channel.

MFC after: 3 days
This commit is contained in:
Julian Elischer 2005-04-17 07:42:28 +00:00
parent 5c83bb4912
commit 0224b85a14
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145180

View file

@ -78,9 +78,17 @@ ua_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *
pa_dev = device_get_parent(sc->sc_dev);
/* Create ua_playfmt[] & ua_recfmt[] */
uaudio_query_formats(pa_dev, (u_int32_t *)&ua_playfmt, (u_int32_t *)&ua_recfmt);
if (ua_playfmt[0] == 0) {
printf("%s channel supported format list invalid\n", dir == PCMDIR_PLAY? "play" : "record");
return NULL;
if (dir == PCMDIR_PLAY) {
if (ua_playfmt[0] == 0) {
printf("play channel supported format list invalid\n");
return NULL;
}
} else {
if (ua_recfmt[0] == 0) {
printf("record channel supported format list invalid\n");
return NULL;
}
}
/* allocate PCM side DMA buffer */