-/*
- * Simple stream reposition routine
- */
-static int aac_reposition_stream(long unsigned request)
-{
- return 1;
-// return -E_AAC_REPOS;
-}
-
-static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
-{
- size_t res = fread(ptr, size, nmemb, stream);
- if (res == nmemb)
- return size * nmemb;
- if (feof(stream))
- return 0;
- return -E_FREAD;
-}
-
-static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
-{
- int ret;
- size_t pos;
-
- *len = 0;
- if (current_chunk >= num_chunks)
- return NULL;
- if (!current_chunk) {
- *len = chunk_table[0];
- pos = entry;
- } else {
- *len = chunk_table[current_chunk] - chunk_table[current_chunk - 1];
- pos = entry + chunk_table[current_chunk - 1];
- }
- if (inbuf_size < *len) {
- inbuf = para_realloc(inbuf, *len);
- inbuf_size = *len;
- }
-// PARA_DEBUG_LOG("reading chunk #%lu@%zd (%zd bytes)\n", current_chunk,
-// pos, *len);
- ret = fseek(infile, pos, SEEK_SET);
- if (ret < 0)
- return NULL;
- ret = para_fread(inbuf, *len, 1, infile);
- if (ret != *len)
- return NULL;
-// PARA_DEBUG_LOG("ret: %d, inbuf[0]: %lx - %lx\n", ret, (long unsigned) inbuf[0],
-// (long unsigned) inbuf[4]);
- return (char *)inbuf;
-}
-
-void aac_afh_init(void *p)
+static const char* aac_suffixes[] = {"m4a", "mp4", NULL};
+/** the init function of the aac audio format handler */
+void aac_afh_init(struct audio_format_handler *p)