From 0d3ea3b043fce01671335e28abde3e1acdbd77fe Mon Sep 17 00:00:00 2001 From: hselasky Date: Wed, 24 Apr 2013 16:52:03 +0000 Subject: Fix for duplicate sample rate detection after recent patches. --- sys/dev/sound/usb/uaudio.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index f1a064e..63e9f43 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1816,13 +1816,20 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, chan->num_alt--; goto next_ep; } - /* we only accumulate one format at different sample rates */ - if (chan->num_alt > 1 && chan->pcm_format[0] != format) { - DPRINTF("Multiple formats is not supported\n"); - chan->num_alt--; - goto next_ep; + if (chan->num_alt > 1) { + /* we only accumulate one format at different sample rates */ + if (chan->pcm_format[0] != format) { + DPRINTF("Multiple formats is not supported\n"); + chan->num_alt--; + goto next_ep; + } + /* ignore if duplicate sample rate entry */ + if (rate == chan->usb_alt[chan->num_alt - 2].sample_rate) { + DPRINTF("Duplicate sample rate detected\n"); + chan->num_alt--; + goto next_ep; + } } - chan->pcm_cap.fmtlist = chan->pcm_format; chan->pcm_cap.fmtlist[0] = format; -- cgit v1.1