diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-04-24 16:52:03 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-04-24 16:52:03 +0000 |
commit | 0d3ea3b043fce01671335e28abde3e1acdbd77fe (patch) | |
tree | cc2027fd3f5196a6e496579a2c6efb9a96500298 /sys/dev/sound/usb/uaudio.c | |
parent | 956702e6712605c8c0ffd2e0f2db91549fe44421 (diff) | |
download | FreeBSD-src-0d3ea3b043fce01671335e28abde3e1acdbd77fe.zip FreeBSD-src-0d3ea3b043fce01671335e28abde3e1acdbd77fe.tar.gz |
Fix for duplicate sample rate detection after recent patches.
Diffstat (limited to 'sys/dev/sound/usb/uaudio.c')
-rw-r--r-- | sys/dev/sound/usb/uaudio.c | 19 |
1 files changed, 13 insertions, 6 deletions
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; |