]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
aac afh: do not send the huge audio file header
[paraslash.git] / aac_afh.c
index ac73fb193aae276df743d85db91e3808711b5fbd..92b70915621ce3fd4472d9595adb5b9fe5485636 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -70,7 +70,7 @@ static int aac_find_stsz(unsigned char *buf, unsigned buflen, unsigned *skip)
                return sample_count;
        }
        PARA_WARNING_LOG("stsz not found, buflen: %d\n", buflen);
-       return -E_STCO;
+       return -E_STSZ;
 }
 
 static int read_chunk_table(unsigned skip)
@@ -192,7 +192,8 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames,
  */
 static int aac_reposition_stream(long unsigned request)
 {
-       return -E_AAC_REPOS;
+       return 1;
+//     return -E_AAC_REPOS;
 }
 
 static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *stream)
@@ -205,7 +206,7 @@ static __must_check int para_fread(void *ptr, size_t size, size_t nmemb, FILE *s
        return -E_FREAD;
 }
 
-char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
+static char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
 {
        int ret;
        size_t pos;
@@ -214,14 +215,11 @@ char *aac_read_chunk(long unsigned current_chunk, ssize_t *len)
        if (current_chunk >= num_chunks)
                return NULL;
        if (!current_chunk) {
-               *len = entry;
-               pos = 0;
-       } else if (current_chunk == 1) {
                *len = chunk_table[0];
                pos = entry;
        } else {
-               *len = chunk_table[current_chunk - 1] - chunk_table[current_chunk - 2];
-               pos = entry + chunk_table[current_chunk - 2];
+               *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);