]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/btr_improvements'
authorAndre Noll <maan@systemlinux.org>
Thu, 19 Jul 2012 16:46:58 +0000 (18:46 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 19 Jul 2012 16:55:56 +0000 (18:55 +0200)
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.

1  2 
NEWS
alsa_write.c
buffer_tree.h
client.c
mp3dec_filter.c
wmadec_filter.c

diff --combined NEWS
index 7fcf7f974a402907019cd0f0805a666cee3b603c,d38b977c60dcb73cc32370177dddd20b50c9cd6e..8f1b91da487d945548b1a8cb16fea0e07f6f40d6
--- 1/NEWS
--- 2/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 8c12c728e551035bd8eca071216e3c7e44060de5,535e7194c07f021e9958907effc5d8816333a8c7..2e096c0c78856e6d0691f31c5fcba768ab3a695d
@@@ -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;
        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 */
                        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 a9890b9854b5bce2fce731a19d6cc44ba538c442,8e8d341d3719946a2934ae24aaec48cfd625f597..b0817759ee145dfd4ef7bb9ddcb5412b6d00b0fd
@@@ -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 f0f3b2617be6f3554250cedfafbbcc92c38f54b7,6268c3de8892f921045e18f2f7e7560ada8c5083..8e3e021d90249f44a0c655c493eb1198ed9f71cf
+++ 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 6955a7423650f3b929b807b6184221d5b5773717,5a177c19b88b49dd1dbbddeb4f617078c4285428..b58c694b4c31040c97284d9684067dcb6df90f71
@@@ -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))
  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 220dc40c22a0810d6ff7ac4484b7ea09e3346a67,a35c174283a4e08b10b8f759839e7656396dbf50..20f9df44b92b35061980d857f86c9ccee40b4bcd
@@@ -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) {
                        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;
                                        break;
                                lpos = pos;
                        }
 -                      pwd->exponent_sizes[k] = j;
 +                      exponent_size = j;
                }
  
                /* max number of coefs */
                /* 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)