X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=caa32d8ef3f77e94d68aa57cdc7283c41725cb07;hp=bcb43a20e610d275294447b4fc4728f8caaece78;hb=95488d221ea22f761a6a4b78410c4e0e89f522b8;hpb=5fde5b4d4abeb795f71101d1fd3524f8a27971eb diff --git a/server.c b/server.c index bcb43a20..caa32d8e 100644 --- a/server.c +++ b/server.c @@ -63,6 +63,7 @@ extern void http_send_init(struct sender *); extern void ortp_send_init(struct sender *); extern struct audio_format afl[]; +/* TODO: This is better handled by autoconf */ /** the list of supported audio file selectors */ struct audio_file_selector selectors[] = { { @@ -436,14 +437,12 @@ int main(int argc, char *argv[]) valid_fd_012(); sockfd = do_inits(argc, argv); repeat: - /* check socket and signal pipe in any case */ FD_ZERO(&rfds); FD_ZERO(&wfds); - FD_SET(sockfd, &rfds); - max_fileno = sockfd; - FD_SET(signal_pipe, &rfds); - max_fileno = MAX(max_fileno, signal_pipe); - + max_fileno = -1; + /* check socket and signal pipe in any case */ + para_fd_set(sockfd, &rfds, &max_fileno); + para_fd_set(signal_pipe, &rfds, &max_fileno); timeout = afs_preselect(); status_refresh(); for (i = 0; senders[i].name; i++) { @@ -458,7 +457,7 @@ repeat: } if (selectors[mmd->selector_num].pre_select) { ret = selectors[mmd->selector_num].pre_select(&rfds, &wfds); - max_fileno = MAX(max_fileno, ret); + max_fileno = PARA_MAX(max_fileno, ret); } mmd_unlock(); ret = para_select(max_fileno + 1, &rfds, &wfds, timeout); @@ -478,10 +477,8 @@ repeat: &afl[mmd->audio_format] : NULL, &rfds, &wfds); } - if (!ret) { - afs_send_chunk(); - status_refresh(); - } + afs_send_chunk(); + status_refresh(); if (FD_ISSET(signal_pipe, &rfds)) { int sig; sig = para_next_signal();