- ret = read(fileno(infile), inbuf, inbuf_size);
- if (ret <= 0)
- return -E_AAC_READ;
- PARA_INFO_LOG("next buffer: %d bytes\n", ret);
- }
- num_chunks = ret;
- PARA_INFO_LOG("sz table has %zu entries\n", num_chunks);
- afi->chunk_table = para_malloc((num_chunks + 1) * sizeof(size_t));
- for (i = 1; i <= num_chunks; i++) {
- 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);
- if (ret <= 0)
- return -E_AAC_READ;
- inbuf_len = ret + skip;
- skip = 0;
- PARA_INFO_LOG("next buffer: %zu bytes\n", inbuf_len);
- }
- sum += aac_read_int32(inbuf + skip);