- free(inbuf);
- inbuf_size = DEFAULT_INBUF_SIZE;
- inbuf = para_malloc(inbuf_size);
- infile = file;
-
- PARA_INFO_LOG("file: %p\n", file);
- ret = read(fileno(infile), inbuf, inbuf_size);
- PARA_INFO_LOG("read %d bytes\n", ret);
- if (ret <= 0)
- return -E_AAC_READ;
- PARA_INFO_LOG("checking aac %d bytes\n", ret);
- inbuf_len = ret;
- ret = aac_find_esds(inbuf, inbuf_len, &skip);
- if (ret < 0)
- return ret;
- decoder_len = ret;
- handle = aac_open();
- ret = NeAACDecInit(handle, inbuf + skip,
- decoder_len, &rate, &channels);
- if (ret < 0)
- return -E_AACDEC_INIT;
- skip += ret;
- PARA_INFO_LOG("rate: %lu, channels: %d\n", rate, channels);
- ret = NeAACDecAudioSpecificConfig(inbuf + skip, inbuf_len - skip, &mp4ASC);
- if (ret >= 0) {
- PARA_DEBUG_LOG("mp4ASC.samplingFrequency: %lu\n",
- mp4ASC.samplingFrequency);
- } else
- PARA_WARNING_LOG("no mp4ASC %s\n", "");
-
- ret = read_chunk_table(skip);