From: Andre Noll Date: Mon, 1 Jul 2013 19:06:48 +0000 (+0200) Subject: Merge branch 't/versioning_improvements' X-Git-Tag: v0.4.13~23 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=e2eebf654cae2fc004cee516a0e165127c0214ca;hp=15e99acfc88ff999980ef97705e794d4849cf40e;p=paraslash.git Merge branch 't/versioning_improvements' Cooking for ~2 weeks. 15e99a version.c: Mark version_git() as const. 9bdebf Remove CODENAME macro. be2f6b gui: Use version_single_line(). d60dae Improve man page layout. 5dbc9a afh/play: Include supported audio formats in help output. 042767 Use self-made help to avoid recompilations on version changes. 48f1fc Provide "purpose" texts. aa74a9 Revamp ggo help. 9f7a49 afh_recv: Replace ggo text section by description. b59e0e Make gengetopt descriptions work. 06b3e7 Introduce version.c to limit recompilation on version changes. 75feac Make all commands print git version and improve version string. b01605 Avoid unwanted log messages during startup. 625fdb Don't check return value of command line parsers unnecessarily. 533b03 Build receivers, filters and writers without -h and -V support. b59a3c filter: Wrap lines in the available filter list. 9e56d3 audioc: Print config file errors. e5264d doc: Rewrite udp sender description 5ec373 client: Fix typo in comment. 6d5159 client: Remove duplicate include. --- diff --git a/Makefile.in b/Makefile.in index e5d87abe..f82afd7b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -181,6 +181,10 @@ $(object_dir)/mp3dec_filter.o: mp3dec_filter.c | $(object_dir) @[ -z "$(Q)" ] || echo 'CC $<' $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $< +$(object_dir)/compress_filter.o: compress_filter.c | $(object_dir) + @[ -z "$(Q)" ] || echo 'CC $<' + $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) -O3 $< + $(object_dir)/aacdec_filter.o: aacdec_filter.c | $(object_dir) @[ -z "$(Q)" ] || echo 'CC $<' $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $< diff --git a/NEWS b/NEWS index 07481964..866904e3 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,13 @@ by clock_gettime() on systems which support it. - Speed and usability improvements for para_gui. - para_client now restores the fd flags of stdin and stdout - on shutdown + on shutdown. + - Improved manual pages. + - Consistent version strings for all executables. + - Reduced depencies on generated files result in fewer + recompilations on changes. + - Performance improvements for the compress filter. + - Improved downloads web page. ----------------------------------------- 0.4.12 (2012-12-20) "volatile relativity" diff --git a/audioc.c b/audioc.c index 164a1554..0edab366 100644 --- a/audioc.c +++ b/audioc.c @@ -43,6 +43,25 @@ static char *concat_args(unsigned argc, char * const *argv) return buf; } +static int connect_audiod(const char *sname, char *args) +{ + int fd = -1, ret; + + ret = connect_local_socket(sname); + if (ret < 0) + goto fail; + fd = ret; + ret = send_cred_buffer(fd, args); + if (ret < 0) + goto fail; + return fd; +fail: + PARA_ERROR_LOG("could not connect %s\n", sname); + if (fd >= 0) + close(fd); + return ret; +} + #ifdef HAVE_READLINE #include "list.h" #include "sched.h" @@ -147,8 +166,6 @@ static int audioc_i9e_line_handler(char *line) { char *args = NULL; int ret; - if (!line || !*line) - return 0; PARA_DEBUG_LOG("line: %s\n", line); ret = create_argv(line, " ", &conf.inputs); @@ -157,15 +174,14 @@ static int audioc_i9e_line_handler(char *line) conf.inputs_num = ret; args = concat_args(conf.inputs_num, conf.inputs); free_argv(conf.inputs); + if (!args) + return 0; conf.inputs_num = 0; /* required for audioc_cmdline_parser_free() */ - ret = connect_local_socket(socket_name); + ret = connect_audiod(socket_name, args); if (ret < 0) goto out; at->fd = ret; ret = mark_fd_nonblocking(at->fd); - if (ret < 0) - goto close; - ret = send_cred_buffer(at->fd, args); if (ret < 0) goto close; free(args); @@ -330,21 +346,16 @@ int main(int argc, char *argv[]) interactive_session(); args = concat_args(conf.inputs_num, conf.inputs); - ret = connect_local_socket(socket_name); + ret = connect_audiod(socket_name, args); free(socket_name); - if (ret < 0) { - PARA_EMERG_LOG("failed to connect to local socket\n"); + if (ret < 0) goto out; - } fd = ret; - ret = send_cred_buffer(fd, args); + ret = mark_fd_blocking(STDOUT_FILENO); if (ret < 0) goto out; bufsize = conf.bufsize_arg; buf = para_malloc(bufsize); - ret = mark_fd_blocking(STDOUT_FILENO); - if (ret < 0) - goto out; do { size_t n = ret = recv_bin_buffer(fd, buf, bufsize); if (ret <= 0) diff --git a/audiod_command.c b/audiod_command.c index 2f3726fa..b49d659e 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -442,7 +442,7 @@ int handle_connect(int accept_fd, fd_set *rfds) if (ret < 0) goto out; ret = create_argv(buf, "\n", &argv); - if (ret < 0) + if (ret <= 0) goto out; argc = ret; //PARA_INFO_LOG("argv[0]: %s, argc = %d\n", argv[0], argc); diff --git a/client.c b/client.c index 3587a971..2d6ef31f 100644 --- a/client.c +++ b/client.c @@ -445,11 +445,9 @@ static int client_i9e_line_handler(char *line) int ret; client_disconnect(ct); - if (!line || !*line) - return 0; - PARA_DEBUG_LOG("line handler: %s\n", line); + PARA_DEBUG_LOG("line: %s\n", line); ret = make_client_argv(line); - if (ret < 0) + if (ret <= 0) return ret; ret = client_connect(ct, &sched, NULL, NULL); if (ret < 0) diff --git a/compress_filter.c b/compress_filter.c index f6108c75..0c0200e7 100644 --- a/compress_filter.c +++ b/compress_filter.c @@ -74,18 +74,23 @@ next_buffer: op = para_malloc(length); for (i = 0; i < length / 2; i++) { /* be careful in that heat, my dear */ - int sample = *ip++, adjusted_sample = (PARA_ABS(sample) * - pcd->current_gain) >> gain_shift; - if (adjusted_sample > 32767) { /* clip */ - PARA_NOTICE_LOG("clip: sample: %d, adjusted sample: %d\n", - sample, adjusted_sample); - adjusted_sample = 32767; + int sample = *ip++; + bool neg = false; + + if (sample < 0) { + sample = -sample; + neg = true; + } + sample *= pcd->current_gain; + sample >>= gain_shift; + if (sample > 32767) { /* clip */ + sample = 32767; pcd->current_gain = (3 * pcd->current_gain + (1 << pcd->conf->inertia_arg)) / 4; pcd->peak = 0; - } else - pcd->peak = PARA_MAX(pcd->peak, adjusted_sample); - op[i] = sample >= 0? adjusted_sample : -adjusted_sample; + } else if (sample > pcd->peak) + pcd->peak = sample; + op[i] = neg? -sample : sample; if (++pcd->num_samples & mask) continue; // PARA_DEBUG_LOG("gain: %u, peak: %u\n", pcd->current_gain, diff --git a/gui.c b/gui.c index 4d2c9f72..baab0bd9 100644 --- a/gui.c +++ b/gui.c @@ -294,7 +294,7 @@ static char *configfile_exists(void) static void add_spaces(WINDOW* win, unsigned int num) { char space[] = " "; - unsigned sz = sizeof(space); + unsigned sz = sizeof(space) - 1; /* number of spaces */ while (num >= sz) { waddstr(win, space); diff --git a/interactive.c b/interactive.c index f2819012..43cb99f2 100644 --- a/interactive.c +++ b/interactive.c @@ -272,6 +272,7 @@ static void clear_bottom_line(void) rl_redisplay(); wipe_bottom_line(); /* wipe out the prompt */ rl_insert_text(text); + free(text); rl_point = point; } @@ -290,21 +291,25 @@ static bool input_available(void) static void i9e_line_handler(char *line) { int ret; + struct btr_node *dummy; + if (!line) { + i9ep->input_eof = true; + return; + } + if (!*line) + goto free_line; + rl_set_prompt(""); + dummy = btr_new_node(&(struct btr_node_description) + EMBRACE(.name = "dummy line handler")); + i9e_attach_to_stdout(dummy); ret = i9ep->ici->line_handler(line); if (ret < 0) PARA_WARNING_LOG("%s\n", para_strerror(-ret)); - rl_set_prompt(""); - if (line) { - if (!*line) - rl_set_prompt(i9ep->ici->prompt); - else - add_history(line); - free(line); - } else { - rl_set_prompt(""); - i9ep->input_eof = true; - } + add_history(line); + btr_remove_node(&dummy); +free_line: + free(line); } static int i9e_post_select(__a_unused struct sched *s, __a_unused struct task *t) diff --git a/oss_mix.c b/oss_mix.c index 9fe86504..5182ad23 100644 --- a/oss_mix.c +++ b/oss_mix.c @@ -56,8 +56,10 @@ static int oss_mix_open(const char *dev, struct mixer_handle **handle) dev = "/dev/mixer"; PARA_INFO_LOG("opening %s\n", dev); ret = para_open(dev, O_RDWR, 42); - if (ret < 0) + if (ret < 0) { + PARA_ERROR_LOG("could not open %s\n", dev); return ret; + } h = para_malloc(sizeof(*h)); h->fd = ret; *handle = h; diff --git a/play.c b/play.c index e6a58fce..6eed58ab 100644 --- a/play.c +++ b/play.c @@ -974,15 +974,7 @@ out: static int play_i9e_line_handler(char *line) { - struct play_task *pt = &play_task; - int ret; - - if (line == NULL || !*line) - return 0; - ret = run_command(line, pt); - if (ret < 0) - return ret; - return 0; + return run_command(line, &play_task); } static int play_i9e_key_handler(int key) diff --git a/web/download.in.html b/web/download.in.html index 563b61af..393fce93 100644 --- a/web/download.in.html +++ b/web/download.in.html @@ -1,13 +1,73 @@

Download


-

Clone the git repository by executing

+Paraslash is only available as source code, no binary packages are +provided at this point. There are several ways to download the source: -

git clone git://paraslash.systemlinux.org/git paraslash

+