]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/speex'
authorAndre Noll <maan@systemlinux.org>
Sun, 1 Aug 2010 11:26:42 +0000 (13:26 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 1 Aug 2010 11:26:42 +0000 (13:26 +0200)
NEWS
aacdec_filter.c
alsa_write.c
buffer_tree.c
configure.ac
error2.pl [new file with mode: 0755]
send_common.c

diff --git a/NEWS b/NEWS
index e1954b3168a7fc9d8287a4503e507c2f129f09ed..d42602730cc3424b6d17dc4c3f60d2e8d8a01def 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
 0.4.4 (to be announced) "persistent regularity"
 -----------------------------------------------
 
+       - aacdec: Fix a bug which could make the AAC decoder segfault.
+       - Support for sample formats other than 16 bit little endian.
+
 ----------------------------------------
 0.4.3 (2010-07-05) "imaginary radiation"
 ----------------------------------------
index 2dd68448b3b130172ba3417cb20eedcfc1fff262..1127fc1132b90d56169c34d732c9343e47e8fa43 100644 (file)
@@ -100,7 +100,7 @@ next_buffer:
                return;
        btr_merge(btrn, fn->min_iqs);
        len = btr_next_buffer(btrn, (char **)&inbuf);
-       len = PARA_MAX(len, (size_t)8192);
+       len = PARA_MIN(len, (size_t)8192);
        consumed = 0;
        iqs = btr_get_input_queue_size(btrn);
        if (!padd->initialized) {
@@ -174,7 +174,8 @@ next_buffer:
                        padd->frame_info.bytesconsumed);
                PARA_ERROR_LOG("%s\n", NeAACDecGetErrorMessage(
                        padd->frame_info.error));
-               consumed++; /* catch 21 */
+               if (consumed < len)
+                       consumed++; /* catch 21 */
                goto success;
        }
        padd->error_count = 0;
index 7f045aad9f5d426c7b09d0d61fadc1cb89094504..d115a52db0ae899be1ec003d4f7e060611b0ee94 100644 (file)
@@ -257,6 +257,7 @@ again:
                if (ret < 0)
                        goto err;
                wn->min_iqs = pad->bytes_per_frame;
+               goto again;
        }
        frames = bytes / pad->bytes_per_frame;
        frames = snd_pcm_writei(pad->handle, data, frames);
index 3a59f8b5e2e20fa20c94117dd31e2655101936cf..d92d9863e10e2b4081fba91a35b06233933a15cc 100644 (file)
@@ -634,7 +634,7 @@ void btr_consume(struct btr_node *btrn, size_t numbytes)
                        numbytes -= br->btrb->size - br->consumed;
                        btr_drop_buffer_reference(br);
                }
-               assert(true);
+               assert(false);
        }
        /*
         * We have a wrap buffer, consume from it. If in total, i.e. including
index 5322e7d1be6a12b5230d15599fc6b323e00e3a0d..a7bd3e1ab5e96bb956b8598af2786aadca2f106c 100644 (file)
@@ -691,53 +691,14 @@ AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
 AC_DEFUN([add_para],[$(for i in $@; do printf "para_$i "; done)])
 AC_DEFUN([objlist_to_errlist],[$(for i in $@; do printf "DEFINE_ERRLIST($(echo $i| tr 'a-z' 'A-Z'));"; done) [const char **para_errlist[[]]] = {$(for i in $@; do printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; done) }])
 ############################################################# error2.h
-AC_DEFUN([define_safe_error_enums],
-[
-       exe=""
-       for i in $executables; do
-#              eval echo checking if $1 is linked into $i
-               for j in $(eval echo \$${i}_errlist_objs); do
-                       if test $j = $1; then
-                               exe="$exe $i"
-                               break;
-                       fi
-               done
-       done
-       #echo "$1 gets linked into $exe"
-       safe_errlists=""
-       for i in $all_errlist_objs; do
-               for j in $exe; do
-                       found=0
-                       for k in $(eval echo \$${j}_errlist_objs); do
-                               if test $k = $i; then
-                                       found=1
-                                       break;
-                               fi
-                       done
-                       if test $found -eq 0; then
-                               break;
-                       fi
-               done
-               if test $found -eq 1; then
-                       safe_errlists="$safe_errlists $i"
-               fi
-       done
-       #echo "safe errlists for $1: $safe_errlists"
-       ss_defs=""
-       for i in $safe_errlists; do
-               echo "SS_ENUM($(echo $i | tr 'a-z' 'A-Z'));"
-       done
-]
-)
-
-
 AC_MSG_NOTICE(creating error2.h)
+for i in $executables; do
+       echo "$i: "
+       eval echo \$${i}_errlist_objs
+done | ./error2.pl > error2.h
 for obj in $all_errlist_objs; do
        SS="$SS SS_$(echo $obj | tr 'a-z' 'A-Z'),"
-       echo "#ifdef MAIN_INPUT_FILE_IS_$obj"
-       define_safe_error_enums($obj)
-       echo "#endif"
-done > error2.h
+done
 AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
        [enum {$SS NUM_SS}],
        [list of all objects that use paraslash's error facility]
@@ -753,28 +714,19 @@ lyrics_id duration directory lyrics_name image_name path hash channels
 last_played num_chunks chunk_time amplification artist title year album
 comment"
 
-# $1: prefix, $2: items
-AC_DEFUN([make_enum_items], [$(
-       for i in $2; do
-               printf "$1_$(echo $i | tr 'a-z' 'A-Z'), "
-       done
-)])
-
-# $1: prefix, $2: items
-AC_DEFUN([make_enum_array], [$(
-       for i in $2; do
-               printf "\"$i\", "
-       done
-)])
-
-AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM,
-       make_enum_items(SI,  $status_items),
-       [enum of all status items]
-)
-AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY,
-       make_enum_array(SI,  $status_items),
-       [char * array of all status items]
-)
+result=
+for i in $status_items; do
+       result="$result SI_$(echo $i | tr 'a-z' 'A-Z'), "
+done
+AC_DEFINE_UNQUOTED(STATUS_ITEM_ENUM, [$result],
+       [enum of all status items])
+
+result=
+for i in $status_items; do
+       result="$result \"$i\", "
+done
+AC_DEFINE_UNQUOTED(STATUS_ITEM_ARRAY, [$result],
+       [char * array of all status items])
 
 AC_DEFINE_UNQUOTED(SERVER_AUDIO_FORMATS, "$server_audio_formats",
        [formats supported by para_server and para_afh])
diff --git a/error2.pl b/error2.pl
new file mode 100755 (executable)
index 0000000..78ff2c5
--- /dev/null
+++ b/error2.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+my %matrix;
+my @executables;
+my %objects;
+
+sub make_matrix
+{
+       my ($line, $e, @fields, $field);
+
+       while (defined($line = <>)) {
+               chomp($line);
+               if ($line =~ "^ *\$") {
+                       next;
+               }
+               @fields = split(" ", $line);
+               while (defined(($field = shift(@fields)))) {
+                       if ($field =~ ":\$") {
+                               $field =~ s/://;
+                               $e = $field;
+                               push(@executables, $e);
+                               next;
+                       }
+                       $matrix{$e . ">" . $field} = 1;
+                       $objects{$field} = 1;
+               }
+       }
+}
+
+sub print_safe_objects
+{
+       my @objs = keys(%objects);
+       my ($o1, $o2, $e);
+
+       foreach $o1 (@objs) {
+               print("#ifdef MAIN_INPUT_FILE_IS_$o1\n");
+               O2: foreach $o2 (@objs) {
+                       foreach $e (@executables) {
+                               if (!defined($matrix{$e . ">" . $o1})) {
+                                       next;
+                               }
+                               if (defined($matrix{$e . ">" . $o2})) {
+                                       next;
+                               }
+                               next O2;
+                       }
+                       $_ = $o2;
+                       tr/a-z/A-Z/;
+                       printf("SS_ENUM(%s);\n", $_);
+               }
+               print("#endif\n");
+       }
+}
+make_matrix;
+print_safe_objects;
index 005583cf52bf425f67727df68600c1094a3c0ad8..33c56e7ab135b50a4c77242cb3534ec67d5d9608 100644 (file)
@@ -261,6 +261,7 @@ void generic_com_off(struct sender_status *ss)
  * Accept a connection on the socket this server is listening on.
  *
  * \param ss The sender whose listening fd is ready for reading.
+ * \param rfds Passed to para_accept(),
  *
  * This must be called only if the socket fd of \a ss is ready for reading.  It
  * calls para_accept() to accept the connection and performs the following