]> git.tue.mpg.de Git - paraslash.git/commitdiff
aac_afh.c: Kill global variable inbuf_size
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Mar 2007 16:44:14 +0000 (17:44 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 11 Mar 2007 16:44:14 +0000 (17:44 +0100)
it's constant and equals AAC_INBUF_SIZE.

aac_afh.c

index 5e5ea965eb3d31ba3241928132b4ed7594719163..1633c00fe9a084a2f4f7090da30208b1948ffccb 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
 #include "fd.h"
 
 /** size of the input buffer, must be big enough to hold header */
-#define DEFAULT_INBUF_SIZE 65536
+#define AAC_INBUF_SIZE 65536
 
 static struct audio_format_handler *af;
 static FILE *infile;
 static unsigned char *inbuf;
-static size_t inbuf_size, inbuf_len, num_chunks;
+static size_t inbuf_len, num_chunks;
 
 static void aac_close_audio_file(void)
 {
@@ -82,7 +82,7 @@ static int read_chunk_table(struct audio_format_info *afi, size_t skip)
                ret = aac_find_stsz(inbuf, inbuf_len, &skip);
                if (ret >= 0)
                        break;
-               ret = read(fileno(infile), inbuf, inbuf_size);
+               ret = read(fileno(infile), inbuf, AAC_INBUF_SIZE);
                if (ret <= 0)
                        return -E_AAC_READ;
                PARA_INFO_LOG("next buffer: %d bytes\n", ret);
@@ -94,7 +94,7 @@ static int read_chunk_table(struct audio_format_info *afi, size_t skip)
                if (skip + 4 > inbuf_len) {
                        skip = inbuf_len - skip;
                        memmove(inbuf, inbuf + inbuf_len - skip, skip);
-                       ret = read(fileno(infile), inbuf + skip, inbuf_size - skip);
+                       ret = read(fileno(infile), inbuf + skip, AAC_INBUF_SIZE - skip);
                        if (ret <= 0)
                                return -E_AAC_READ;
                        inbuf_len = ret + skip;
@@ -137,11 +137,10 @@ static int aac_get_file_info(FILE *file, struct audio_format_info *afi)
        mp4AudioSpecificConfig mp4ASC;
        NeAACDecHandle handle;
 
-       inbuf_size = DEFAULT_INBUF_SIZE;
-       inbuf = para_malloc(inbuf_size);
+       inbuf = para_malloc(AAC_INBUF_SIZE);
        infile = file;
 
-       ret = read(fileno(infile), inbuf, inbuf_size);
+       ret = read(fileno(infile), inbuf, AAC_INBUF_SIZE);
        if (ret <= 0)
                return -E_AAC_READ;
        inbuf_len = ret;
@@ -169,7 +168,7 @@ static int aac_get_file_info(FILE *file, struct audio_format_info *afi)
                ret = aac_find_entry_point(inbuf, inbuf_len, &skip);
                if (ret >= 0)
                        break;
-               ret = read(fileno(infile), inbuf, inbuf_size);
+               ret = read(fileno(infile), inbuf, AAC_INBUF_SIZE);
                if (ret <= 0)
                        return -E_AAC_READ;
                PARA_INFO_LOG("next buffer: %d bytes\n", ret);