Date: Wed, 24 Apr 2013 16:52:04 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249845 - head/sys/dev/sound/usb Message-ID: <201304241652.r3OGq4g5021999@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Apr 24 16:52:03 2013 New Revision: 249845 URL: http://svnweb.freebsd.org/changeset/base/249845 Log: Fix for duplicate sample rate detection after recent patches. Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Apr 24 16:22:53 2013 (r249844) +++ head/sys/dev/sound/usb/uaudio.c Wed Apr 24 16:52:03 2013 (r249845) @@ -1816,13 +1816,20 @@ uaudio_chan_fill_info_sub(struct uaudio_ 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304241652.r3OGq4g5021999>