]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/decoder_fixes'
authorAndre Noll <maan@systemlinux.org>
Tue, 26 Jun 2012 20:07:55 +0000 (22:07 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 26 Jun 2012 20:11:07 +0000 (22:11 +0200)
97dbfe wmadec: Only decode one superframe at a time.
d6e017 flacdec: Only process a single flac audio frame.
1e1968 flacdec_close(): Be liberal in what you accept.
3f96f9 oggdec: Fix EOF handling on repositioning.
c7e2f7 oggdec: Realloc buffer to save memory.
634e75 oggdec: Do not decode more than necessary.

These changes are well tested and there are no known problems.

1  2 
NEWS
wmadec_filter.c

diff --combined NEWS
index fa8e0249be9945f08cd4bf9c36531854cf8000f5,0ac2240effe91e4294c8ec901fe18f9c143e42d3..df54a6412db9ef55d4b580cbf7328b72f4a6e07f
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -2,10 -2,8 +2,11 @@@
  0.4.11 (to be announced) "mutual diversity"
  -------------------------------------------
  
 +      - 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.
        - Documentation improvements.
  
  ------------------------------------------
diff --combined wmadec_filter.c
index be726108818b826ebc4a7f17ac773eb31a1786b8,5106724d90778097c80fa3a1e6a44578a3770ac6..e58754f5f5658886f8e4d9c238b5093db1980dbe
@@@ -71,9 -71,7 +71,9 @@@ struct private_wmadec_data 
        int use_exp_vlc;
        /** Whether perceptual noise is added. */
        int use_noise_coding;
 +      /** Depends on number of the bits per second and the frame length. */
        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];
@@@ -504,8 -502,9 +504,8 @@@ static int wma_decode_init(char *initia
  
        if (pwd->use_exp_vlc) {
                PARA_INFO_LOG("using exp_vlc\n");
 -              init_vlc(&pwd->exp_vlc, EXPVLCBITS,
 -              sizeof(wma_scale_huffbits), wma_scale_huffbits,
 -              wma_scale_huffcodes, 4);
 +              init_vlc(&pwd->exp_vlc, EXPVLCBITS, sizeof(wma_scale_huffbits),
 +                      wma_scale_huffbits, wma_scale_huffcodes, 4);
        } else {
                PARA_INFO_LOG("using curve\n");
                wma_lsp_to_curve_init(pwd, pwd->frame_len);
@@@ -1214,11 -1213,11 +1214,11 @@@ static int wmadec_execute(struct btr_no
  static void wmadec_post_select(__a_unused struct sched *s, struct task *t)
  {
        struct filter_node *fn = container_of(t, struct filter_node, task);
-       int ret, converted;
+       int ret, converted, out_size;
        struct private_wmadec_data *pwd = fn->private_data;
        struct btr_node *btrn = fn->btrn;
        size_t len;
-       char *in;
+       char *in, *out;
  
  next_buffer:
        converted = 0;
                goto success;
        }
        fn->min_iqs = WMA_FRAME_SKIP + pwd->ahi.block_align;
-       for (;;) {
-               char *out;
-               int out_size = WMA_OUTPUT_BUFFER_SIZE;
-               if (converted + fn->min_iqs > len)
-                       break;
-               out = para_malloc(WMA_OUTPUT_BUFFER_SIZE);
-               ret = wma_decode_superframe(pwd, out,
-                       &out_size, (uint8_t *)in + converted + WMA_FRAME_SKIP,
-                       len - WMA_FRAME_SKIP);
-               if (ret < 0) {
-                       free(out);
-                       goto err;
-               }
-               btr_add_output(out, out_size, btrn);
-               converted += ret + WMA_FRAME_SKIP;
+       if (fn->min_iqs > len)
+               goto success;
+       out_size = WMA_OUTPUT_BUFFER_SIZE;
+       out = para_malloc(out_size);
+       ret = wma_decode_superframe(pwd, out, &out_size,
+               (uint8_t *)in + WMA_FRAME_SKIP, len - WMA_FRAME_SKIP);
+       if (ret < 0) {
+               free(out);
+               goto err;
        }
+       out = para_realloc(out, out_size);
+       if (out_size > 0)
+               btr_add_output(out, out_size, btrn);
+       converted += ret + WMA_FRAME_SKIP;
  success:
        btr_consume(btrn, converted);
        return;