svn commit: r249845 - head/sys/dev/sound/usb

Hans Petter Selasky hselasky at FreeBSD.org
Wed Apr 24 16:52:04 UTC 2013


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;
 


More information about the svn-src-all mailing list