ao_oss: add hotplug support, improve list_devs - #18221
Conversation
rozhuk-im
commented
Jul 5, 2026
- Add hotplug support for FreeBSD and DragonFlyBSD
- Improve list_devs(): switch to scandir()
| if (stat(dev_path, &st) != 0) | ||
| continue; | ||
| device_descr_get(i, dev_descr, sizeof(dev_descr)); | ||
| rc = scandir("/dev", &dirp, scandir_filter_cb, alphasort); |
There was a problem hiding this comment.
alphasort is locale dependent, should not be used. Also all other mpv code use opendir/readdir instead of scandir.
There was a problem hiding this comment.
versionsort is better for this, but in any case order in this is not critical.
scandir is not forbidden to use. I prefer it to get more compact code.
There was a problem hiding this comment.
versionsortis better for this, but in any case order in this is not critical.
No. It is also locale dependent and is GNU extension. Please use mp_natural_sort_cmp for filename comparision which is the current standard in code.
scandiris not forbidden to use. I prefer it to get more compact code.
It requires the use of a compare function which as you said is not necessary for this at all.
There was a problem hiding this comment.
Compare function is needed to sort dev list, unsorted dev list still usable but not so pretty :)
7219bbd to
790f770
Compare