]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
random/mysql selector: make it find m4a files
[paraslash.git] / aac_afh.c
index d4a1866aeda37132531153c84c17d2f92a5b0f51..55efeefa1d7dc1b067e23da06294a7fb222e9304 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -37,16 +37,19 @@ static FILE *infile;
 static int inbuf_size;
 static unsigned char *inbuf;
 static size_t inbuf_len;
 static int inbuf_size;
 static unsigned char *inbuf;
 static size_t inbuf_len;
-struct audio_format *af;
+struct audio_format_handler *af;
 static size_t num_chunks;
 static size_t entry;
 
 static size_t *chunk_table;
 NeAACDecHandle handle;
 
 static size_t num_chunks;
 static size_t entry;
 
 static size_t *chunk_table;
 NeAACDecHandle handle;
 
-
 static void aac_close_audio_file(void)
 {
 static void aac_close_audio_file(void)
 {
+       if (!infile)
+               return;
+       fclose(infile);
+       infile = NULL;
 }
 
 static int aac_find_stsz(unsigned char *buf, unsigned buflen, size_t *skip)
 }
 
 static int aac_find_stsz(unsigned char *buf, unsigned buflen, size_t *skip)
@@ -230,6 +233,8 @@ static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
        return (char *)inbuf;
 }
 
        return (char *)inbuf;
 }
 
+static const char* aac_suffixes[] = {"m4a", NULL};
+/** the init function of the aac audio format handler */
 void aac_afh_init(void *p)
 {
        af = p;
 void aac_afh_init(void *p)
 {
        af = p;
@@ -241,4 +246,5 @@ void aac_afh_init(void *p)
        af->chunk_tv.tv_sec = 0;
        af->chunk_tv.tv_usec = 23120;
        tv_scale(3, &af->chunk_tv, &af->eof_tv);
        af->chunk_tv.tv_sec = 0;
        af->chunk_tv.tv_usec = 23120;
        tv_scale(3, &af->chunk_tv, &af->eof_tv);
+       af->suffixes = aac_suffixes;
 }
 }