Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142732214
D44051.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
917 B
Referenced Files
None
Subscribers
None
D44051.diff
View Options
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -2768,20 +2768,19 @@
uaudio_chan_set_param_speed(struct uaudio_chan *ch, uint32_t speed)
{
struct uaudio_softc *sc;
- uint8_t x;
+ uint8_t x, y;
sc = ch->priv_sc;
- for (x = 0; x < ch->num_alt; x++) {
- if (ch->usb_alt[x].sample_rate < speed) {
- /* sample rate is too low */
- break;
- }
+ for (x = 0, y = 1; y < ch->num_alt; y++) {
+ /* prefer sample rate closer to and greater than requested */
+ if ((ch->usb_alt[x].sample_rate < speed &&
+ ch->usb_alt[x].sample_rate < ch->usb_alt[y].sample_rate) ||
+ (speed <= ch->usb_alt[y].sample_rate &&
+ ch->usb_alt[y].sample_rate < ch->usb_alt[x].sample_rate))
+ x = y;
}
- if (x != 0)
- x--;
-
usb_proc_explore_lock(sc->sc_udev);
ch->set_alt = x;
usb_proc_explore_unlock(sc->sc_udev);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 8:22 PM (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27883369
Default Alt Text
D44051.diff (917 B)
Attached To
Mode
D44051: snd_uaudio(4): Fix sample rate selection after 42fdcd9fd917.
Attached
Detach File
Event Timeline
Log In to Comment