X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=grab_client.c;h=6769ee522ef3dfcd7dac66fb0c299c4ee0e37ef7;hb=d7cda933daa35663b2b9b61d62cb514afa37fd18;hp=5fb9a83b54294960eb6f4df8ccd371aa5d998f3a;hpb=741023c2fdff99a9402939fe5e5cafad4ac08df3;p=paraslash.git diff --git a/grab_client.c b/grab_client.c index 5fb9a83b..6769ee52 100644 --- a/grab_client.c +++ b/grab_client.c @@ -32,15 +32,7 @@ #include "audiod.h" #include "error.h" #include "string.h" - - -/** this maps the enum to the text used at the command line */ -static const char *gc_modes[] = { - [GRAB_PEDANTIC] = "pedantic", - [GRAB_SLOPPY] = "sloppy", - [GRAB_AGGRESSIVE] = "aggressive", - NULL -}; +#include "fd.h" /** grab clients that are not yet attached to a filter node */ struct list_head inactive_grab_client_list; @@ -65,12 +57,10 @@ static int gc_write(char *buf, size_t len, struct filter_callback *fcb) // PARA_INFO_LOG("writing %d bytes to fd %d\n", len, gc->fd); fd_set wfds; - do { - FD_ZERO(&wfds); - FD_SET(gc->fd, &wfds); - ret = select(gc->fd + 1, NULL, &wfds, NULL, &tv); - } while (ret == EAGAIN || ret == EINTR); - if (ret != 1) { + FD_ZERO(&wfds); + FD_SET(gc->fd, &wfds); + ret = para_select(gc->fd + 1, NULL, &wfds, &tv); + if (ret <= 0) { if (gc->mode == GRAB_PEDANTIC) return -E_PEDANTIC_GRAB; if (gc->mode == GRAB_SLOPPY) @@ -99,13 +89,12 @@ static int check_gc_args(struct grab_client *gc) { int i; struct grab_client_args_info *conf = gc->conf; + char **mv = grab_client_cmdline_parser_mode_values; PARA_INFO_LOG("filter_num: %d\n", gc->conf->filter_num_arg); - for (i = 0; gc_modes[i]; i++) - if (!strcmp(conf->mode_arg, gc_modes[i])) + for (i = 0; mv[i]; i++) + if (!strcmp(conf->mode_arg, mv[i])) break; - if (!gc_modes[i]) - return -E_INVALID_GRAB_MODE; gc->mode = i; if (conf->audio_format_given) { gc->audio_format_num = get_audio_format_num(conf->audio_format_arg);