]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
add a close function for the aac audio format handler.
authorAndre <maan@p133.(none)>
Sat, 13 May 2006 20:01:36 +0000 (22:01 +0200)
committerAndre <maan@p133.(none)>
Sat, 13 May 2006 20:01:36 +0000 (22:01 +0200)
Without this, we're leaking one fd per audio file...

aac_afh.c

index d4a1866aeda37132531153c84c17d2f92a5b0f51..5ace47e5762749a6f0efff37398932ec168a92d7 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -44,9 +44,12 @@ static size_t entry;
 static size_t *chunk_table;
 NeAACDecHandle handle;
 
 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,7 @@ static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
        return (char *)inbuf;
 }
 
        return (char *)inbuf;
 }
 
+/** 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;