#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)
{
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);
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;
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;
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);