Skip to content

add sndio support (again, to dev branch) #322

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

Merged
merged 3 commits into from
Apr 11, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
cosme
rewrite

    int err;
    err = poll_sndio();
    if (err < 0) {
        :

to

    if (poll_sndio() < 0) {
        :
  • Loading branch information
jg1uaa committed Feb 25, 2021
commit 0c285a0c6db955ed24d21cdc1b7f7a3428f9243b
10 changes: 3 additions & 7 deletions src/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,6 @@ int audio_get (int a)
int n;
#if USE_ALSA
int retries = 0;
#elif USE_SNDIO
int err;
#endif

#if STATISTICS
Expand Down Expand Up @@ -1135,8 +1133,7 @@ int audio_get (int a)
while (adev[a].inbuf_next >= adev[a].inbuf_len) {

assert (adev[a].sndio_in_handle != NULL);
err = poll_sndio (adev[a].sndio_in_handle, POLLIN);
if (err < 0) {
if (poll_sndio (adev[a].sndio_in_handle, POLLIN) < 0) {
adev[a].inbuf_len = 0;
adev[a].inbuf_next = 0;
return (-1);
Expand Down Expand Up @@ -1436,15 +1433,14 @@ int audio_flush (int a)

int k;
unsigned char *ptr;
int len, err;
int len;

ptr = adev[a].outbuf_ptr;
len = adev[a].outbuf_len;

while (len > 0) {
assert (adev[a].sndio_out_handle != NULL);
err = poll_sndio (adev[a].sndio_out_handle, POLLOUT);
if (err < 0) {
if (poll_sndio (adev[a].sndio_out_handle, POLLOUT) < 0) {
text_color_set(DW_COLOR_ERROR);
perror("Can't write to audio device");
adev[a].outbuf_len = 0;
Expand Down