From e0cb9a6e8a1fb49eb28333386937934abde29260 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 11 Mar 2007 17:44:14 +0100 Subject: [PATCH] aac_afh.c: Kill global variable inbuf_size it's constant and equals AAC_INBUF_SIZE. --- aac_afh.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/aac_afh.c b/aac_afh.c index 5e5ea965..1633c00f 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -31,12 +31,12 @@ #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); -- 2.39.5