X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=play.c;h=814ec16a5288cd7ba4be5c0bbea275a9fc812ef6;hp=cca203b5d393aa95dc50d0e7df1ffcceb0180420;hb=b01605d7062e4d1f005d5aaaaed158d8efe06d79;hpb=f652ce6afe7f6fd0e42814505234cbf4321a736e diff --git a/play.c b/play.c index cca203b5..814ec16a 100644 --- a/play.c +++ b/play.c @@ -7,7 +7,6 @@ /** \file play.c Paraslash's standalone player. */ #include -#include #include #include @@ -177,12 +176,11 @@ static void parse_config_or_die(int argc, char *argv[]) .print_errors = 1 }; - if (play_cmdline_parser_ext(argc, argv, &conf, ¶ms)) - exit(EXIT_FAILURE); + play_cmdline_parser_ext(argc, argv, &conf, ¶ms); HANDLE_VERSION_FLAG("play", conf); + loglevel = get_loglevel_by_name(conf.loglevel_arg); if (conf.help_given || conf.detailed_help_given) print_help_and_die(); - loglevel = get_loglevel_by_name(conf.loglevel_arg); if (conf.config_file_given) config_file = para_strdup(conf.config_file_arg); else { @@ -199,6 +197,7 @@ static void parse_config_or_die(int argc, char *argv[]) params.initialize = 0; params.check_required = 1; play_cmdline_parser_config_file(config_file, &conf, ¶ms); + loglevel = get_loglevel_by_name(conf.loglevel_arg); } for (i = 0; i < conf.key_map_given; i++) { char *s = strchr(conf.key_map_arg[i] + 1, ':'); @@ -1196,7 +1195,7 @@ static unsigned get_time_string(struct play_task *pt, char **result) ); } -static void play_post_select(struct sched *s, struct task *t) +static int play_post_select(struct sched *s, struct task *t) { struct play_task *pt = container_of(t, struct play_task, task); int ret; @@ -1204,7 +1203,7 @@ static void play_post_select(struct sched *s, struct task *t) ret = eof_cleanup(pt); if (ret < 0) { pt->rq = CRT_TERM_RQ; - return; + return 0; } ret = session_post_select(s, t); if (ret < 0) @@ -1234,7 +1233,7 @@ static void play_post_select(struct sched *s, struct task *t) } ret = 1; out: - t->error = ret; + return ret; } /** @@ -1255,7 +1254,7 @@ int main(int argc, char *argv[]) filter_init(); writer_init(); - gettimeofday(now, NULL); + clock_get_realtime(now); sched.default_timeout.tv_sec = 5; parse_config_or_die(argc, argv);