X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=server.c;h=1805c92b62de84d7131bf71c905dc3d8d23a0d93;hp=e10c1e0343c77f1462bb7117b38486f39161411f;hb=b0cad48a864fe3f621138e717ff025060c396fad;hpb=a8a78f935dcefa8a7fcda8dae80bca64fe39d632 diff --git a/server.c b/server.c index e10c1e03..1805c92b 100644 --- a/server.c +++ b/server.c @@ -33,6 +33,7 @@ #include "db.h" #include "server.h" #include "afs.h" +#include "afh.h" /* FIXME */ #include "config.h" #include "close_on_fork.h" #include "send.h" @@ -61,8 +62,8 @@ char *user_list = NULL; extern void dccp_send_init(struct sender *); 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 = PARA_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++) { @@ -451,10 +450,7 @@ repeat: continue; if (!senders[i].pre_select) continue; - senders[i].pre_select(mmd->audio_format >= 0? - &afl[mmd->audio_format] : NULL, - &max_fileno, - &rfds, &wfds); + senders[i].pre_select( &max_fileno, &rfds, &wfds); } if (selectors[mmd->selector_num].pre_select) { ret = selectors[mmd->selector_num].pre_select(&rfds, &wfds); @@ -474,14 +470,10 @@ repeat: continue; if (!senders[i].post_select) continue; - senders[i].post_select(mmd->audio_format >= 0? - &afl[mmd->audio_format] : NULL, - &rfds, &wfds); - } - if (!ret) { - afs_send_chunk(); - status_refresh(); + senders[i].post_select(&rfds, &wfds); } + afs_send_chunk(); + status_refresh(); if (FD_ISSET(signal_pipe, &rfds)) { int sig; sig = para_next_signal();