#define AAC_INBUF_SIZE 65536
static FILE *infile;
-static unsigned char *inbuf;
-static size_t inbuf_len;
static void aac_close_audio_file(void)
{
return -E_STSZ;
}
-static int read_chunk_table(struct audio_format_info *afi, size_t skip)
+static int read_chunk_table(struct audio_format_info *afi, unsigned char *inbuf,
+ size_t inbuf_len, size_t skip)
{
int ret, i;
size_t sum = 0;
static int aac_get_file_info(FILE *file, struct audio_format_info *afi)
{
int i, ret, decoder_len;
- size_t skip;
+ size_t inbuf_len, skip;
unsigned long rate = 0;
- unsigned char channels = 0;
+ unsigned char channels = 0, *inbuf = para_malloc(AAC_INBUF_SIZE);
mp4AudioSpecificConfig mp4ASC;
NeAACDecHandle handle;
- inbuf = para_malloc(AAC_INBUF_SIZE);
infile = file;
-
ret = read(fileno(infile), inbuf, AAC_INBUF_SIZE);
if (ret <= 0) {
ret = -E_AAC_READ;
if (NeAACDecAudioSpecificConfig(inbuf + skip, inbuf_len - skip,
&mp4ASC) < 0)
goto out;
- ret = read_chunk_table(afi, skip);
+ ret = read_chunk_table(afi, inbuf, inbuf_len, skip);
if (ret < 0)
goto out;
afi->seconds_total = aac_set_chunk_tv(afi, &mp4ASC);