From: Andre Noll Date: Thu, 19 Jul 2012 16:46:58 +0000 (+0200) Subject: Merge branch 't/btr_improvements' X-Git-Tag: v0.4.11~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=b66dfd41e268e64b65d2990bdec3d3a7e119e234;hp=-c Merge branch 't/btr_improvements' 146316 btr_exec_up(): Also ask given node. 6d9c35 btr: Introduce btr_add_output_dont_free(). 4ac313 btr: Remove btr_free_node(). Has been cooking in next for a week. --- b66dfd41e268e64b65d2990bdec3d3a7e119e234 diff --combined NEWS index 7fcf7f97,d38b977c..8f1b91da --- a/NEWS +++ b/NEWS @@@ -2,16 -2,14 +2,24 @@@ 0.4.11 (to be announced) "mutual diversity" ------------------------------------------- ++The major feature in this release is the new sideband API for ++client-server communication. This API will be used exclusively starting ++with 0.5.0, which breaks backward compatibility but allows to get rid ++of quite some compatibility code. Other noteworthy changes include ++decoder latency improvements and a long-standing bug fix for the ++ALSA writer. ++ - Sideband connections: If both para_server and para_client support this feature, data is sent as a multiplexed stream. - The --no_default_filters option of para_filter has been removed. - Several fixes and latency improvements to various decoders. -- - The alsa writer now limits the prebuffer time to 500ms. ++ - The ALSA writer now limits the prebuffer time to 500ms. - Documentation improvements. - Overhaul of the command_util.sh script. + - Fixes for some minor problems found by the clang analyzer. + - Compiles (almost) without warnings on gcc-3. ++ - Robustness improvements of the buffer tree code. ------------------------------------------ 0.4.10 (2012-03-30) "heterogeneous vacuum" diff --combined alsa_write.c index 8c12c728,535e7194..2e096c0c --- a/alsa_write.c +++ b/alsa_write.c @@@ -72,7 -72,7 +72,7 @@@ static int alsa_init(struct private_als snd_pcm_sw_params_t *swparams; snd_pcm_uframes_t start_threshold, stop_threshold; snd_pcm_uframes_t buffer_size, period_size; - snd_output_t *log; + snd_output_t *output_log; unsigned buffer_time; int ret; const char *msg; @@@ -163,12 -163,12 +163,12 @@@ ret = snd_pcm_nonblock(pad->handle, 1); if (ret < 0) goto fail; - ret = snd_output_buffer_open(&log); + ret = snd_output_buffer_open(&output_log); if (ret == 0) { char *buf; PARA_INFO_LOG("dumping alsa configuration\n"); - snd_pcm_dump(pad->handle, log); - snd_output_buffer_string(log, &buf); + snd_pcm_dump(pad->handle, output_log); + snd_output_buffer_string(output_log, &buf); for (;;) { char *p = strchr(buf, '\n'); if (!p) /* omit last output line, it's empty */ @@@ -177,7 -177,7 +177,7 @@@ PARA_INFO_LOG("%s\n", buf); buf = p + 1; } - snd_output_close(log); + snd_output_close(output_log); } return 1; fail: @@@ -324,7 -324,7 +324,7 @@@ again ret = -E_ALSA; err: assert(ret < 0); - btr_remove_node(btrn); + btr_remove_node(&wn->btrn); t->error = ret; } diff --combined buffer_tree.h index a9890b98,8e8d341d..b0817759 --- a/buffer_tree.h +++ b/buffer_tree.h @@@ -182,9 -182,9 +182,9 @@@ void btr_copy(const void *src, size_t n struct btr_node *btrn); struct btr_node *btr_new_node(struct btr_node_description *bnd); - void btr_remove_node(struct btr_node *btrn); - void btr_free_node(struct btr_node *btrn); + void btr_remove_node(struct btr_node **btrnp); void btr_add_output(char *buf, size_t size, struct btr_node *btrn); + void btr_add_output_dont_free(const char *buf, size_t size, struct btr_node *btrn); size_t btr_get_input_queue_size(struct btr_node *btrn); size_t btr_get_output_queue_size(struct btr_node *btrn); bool btr_no_parent(struct btr_node *btrn); @@@ -196,7 -196,7 +196,7 @@@ void btr_splice_out_node(struct btr_nod void btr_pushdown(struct btr_node *btrn); void *btr_context(struct btr_node *btrn); void btr_merge(struct btr_node *btrn, size_t dest_size); -void btr_log_tree(struct btr_node *btrn, int loglevel); +void btr_log_tree(struct btr_node *btrn, int ll); void btr_pushdown_one(struct btr_node *btrn); bool btr_inplace_ok(struct btr_node *btrn); int btr_node_status(struct btr_node *btrn, size_t min_iqs, diff --combined client.c index f0f3b261,6268c3de..8e3e021d --- a/client.c +++ b/client.c @@@ -114,11 -114,11 +114,11 @@@ static int execute_client_command(cons goto out; schedule(&command_sched); *result = exec_task.result_buf; - btr_remove_node(exec_task.btrn); + btr_remove_node(&exec_task.btrn); client_disconnect(ct); ret = 1; out: - btr_free_node(exec_task.btrn); + btr_remove_node(&exec_task.btrn); if (ret < 0) free(exec_task.result_buf); return ret; @@@ -307,7 -307,7 +307,7 @@@ static void setatt_completer(struct i9e free(orig); } sl[2 * num_atts] = NULL; - ret = i9e_extract_completions(ci->word, sl, &cr->matches); + i9e_extract_completions(ci->word, sl, &cr->matches); out: free(buf); free_argv(sl); @@@ -619,7 -619,7 +619,7 @@@ out if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret)); client_close(ct); - btr_free_node(sit.btrn); - btr_free_node(sot.btrn); + btr_remove_node(&sit.btrn); + btr_remove_node(&sot.btrn); return ret < 0? EXIT_FAILURE : EXIT_SUCCESS; } diff --combined mp3dec_filter.c index 6955a742,5a177c19..b58c694b --- a/mp3dec_filter.c +++ b/mp3dec_filter.c @@@ -130,7 -130,7 +130,7 @@@ decode ret = handle_decode_error(pmd); if (ret < 0) goto err; - ret = mad_stream_sync(&pmd->stream); + mad_stream_sync(&pmd->stream); if (pmd->stream.error == MAD_ERROR_BUFLEN) { ret = -E_MP3DEC_EOF; if (len == iqs && btr_no_parent(btrn)) @@@ -166,7 -166,7 +166,7 @@@ err: assert(ret < 0); t->error = ret; - btr_remove_node(btrn); + btr_remove_node(&fn->btrn); } static void mp3dec_open(struct filter_node *fn) diff --combined wmadec_filter.c index 220dc40c,a35c1742..20f9df44 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@@ -75,6 -75,7 +75,6 @@@ struct private_wmadec_data int byte_offset_bits; /** Only used if use_exp_vlc is true. */ struct vlc exp_vlc; - int exponent_sizes[BLOCK_NB_SIZES]; uint16_t exponent_bands[BLOCK_NB_SIZES][25]; /** The index of the first coef in high band. */ int high_band_start[BLOCK_NB_SIZES]; @@@ -228,9 -229,8 +228,9 @@@ static void compute_scale_factor_band_s const uint8_t *table; for (k = 0; k < pwd->nb_block_sizes; k++) { - block_len = pwd->frame_len >> k; + int exponent_size; + block_len = pwd->frame_len >> k; table = NULL; a = pwd->frame_len_bits - BLOCK_MIN_BITS - k; if (a < 3) { @@@ -245,7 -245,7 +245,7 @@@ n = *table++; for (i = 0; i < n; i++) pwd->exponent_bands[k][i] = table[i]; - pwd->exponent_sizes[k] = n; + exponent_size = n; } else { j = 0; lpos = 0; @@@ -262,7 -262,7 +262,7 @@@ break; lpos = pos; } - pwd->exponent_sizes[k] = j; + exponent_size = j; } /* max number of coefs */ @@@ -270,7 -270,7 +270,7 @@@ /* high freq computation */ pwd->high_band_start[k] = (int) ((block_len * 2 * high_freq) / ahi->sample_rate + 0.5); - n = pwd->exponent_sizes[k]; + n = exponent_size; j = 0; pos = 0; for (i = 0; i < n; i++) { @@@ -1267,7 -1267,7 +1267,7 @@@ success err: assert(ret < 0); t->error = ret; - btr_remove_node(btrn); + btr_remove_node(&fn->btrn); } static void wmadec_open(struct filter_node *fn)