The loop counter is also the card's index, so ncards is redundant.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential D45144
sound: Remove ncards variable from sound_oss_card_info() christos on May 9 2024, 8:08 PM. Authored by Tags None Referenced Files
Subscribers
Details The loop counter is also the card's index, so ncards is redundant. Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment Actions This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user. |