From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 16:52:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5AF7868C; Wed, 24 Apr 2013 16:52:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4DE30102B; Wed, 24 Apr 2013 16:52:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3OGq4du022000; Wed, 24 Apr 2013 16:52:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OGq4g5021999; Wed, 24 Apr 2013 16:52:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201304241652.r3OGq4g5021999@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 24 Apr 2013 16:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249845 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 16:52:04 -0000 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;