-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add sndio(7) support which is the only supported mixer backend on OpenBSD #470
base: main
Are you sure you want to change the base?
Conversation
@@ -50,6 +50,10 @@ if get_option('pulseaudio') | |||
cdata.set('HAS_PULSEAUDIO', 1) | |||
endif | |||
|
|||
if get_option('sndio') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of making this feature optional, can you make it non-optional on OpenBSD please?
src/sndio.c
Outdated
static void ondesc(void *unused, struct sioctl_desc *d, int val) { | ||
struct control *i, **pi; | ||
|
||
if (d == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and elsewhere, please add braces:
if (d == NULL) {
return;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
#include "i3status.h" | ||
|
||
struct control { | ||
struct control *next; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not to use the include/queue.h macros for this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see the reason why for such simple code, but doable if you insist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not really about complexity, but rather uniformity and code re-use. No need to have multiple linked list implementations within the same project… :)
src/sndio.c
Outdated
static void onval(void *unused, unsigned int addr, unsigned int value) { | ||
struct control *c; | ||
|
||
for (c = controls;; c = c->next) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not for (c = controls; c != NULL; c = c->next)
instead of the explicit if (c == NULL) { return }
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
This pull request adds sndio support to i3status. This is the only supported mixer backend
on OpenBSD so let's disable everything else.