]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
aac: make find_stco() return the first offset
[paraslash.git] / aac_afh.c
index 9cab39205d9739736653fa359240aeebaf9508f9..93bcd427008e1ec088d9501394f5e1b5f108408f 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -128,8 +128,9 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames,
        ret = read_stsz(skip);
        if (ret < 0)
                return ret;
+       *frames = num_chunks;
        for (;;) {
-               ret = aac_find_stco(inbuf, inbuf_len, &skip);
+               ret = aac_find_entry(inbuf, inbuf_len, &skip);
                if (ret >= 0)
                        break;
                ret = read(fileno(infile), inbuf, inbuf_size);
@@ -137,8 +138,7 @@ static int aac_get_file_info(FILE *file, char *info_str, long unsigned *frames,
                        return -E_AAC_READ;
                PARA_INFO_LOG("next buffer: %d bytes\n", ret);
        }
-       *frames = ret;
-       entry = aac_read_int32(inbuf + skip);
+       entry = ret;
        PARA_INFO_LOG("offset table has %d entries\, entry: %zd\n", num_chunks,
                entry);
 #if 1