]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
server: Store max chunk size in database.
[paraslash.git] / aac_afh.c
index a30be96f4f9da70b841e26fd16a3044ebc1df8ac..97b0f4741fba22f31fff7370a9fbb8941f995463 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -34,11 +34,11 @@ static int aac_find_stsz(char *buf, size_t buflen, off_t *skip)
                PARA_DEBUG_LOG("found stsz@%d\n", i);
                i += 8;
                sample_size = read_u32_be(buf + i);
-               PARA_DEBUG_LOG("sample size: %d\n", sample_size);
+               PARA_DEBUG_LOG("sample size: %u\n", sample_size);
                i += 4;
                sample_count = read_u32_be(buf + i);
                i += 4;
-               PARA_DEBUG_LOG("sample count: %d\n", sample_count);
+               PARA_DEBUG_LOG("sample count: %u\n", sample_count);
                *skip = i;
                return sample_count;
        }
@@ -183,8 +183,6 @@ static int aac_set_chunk_tv(struct afh_info *afhi,
        struct timeval total;
        long unsigned ms;
 
-       if (!mp4ASC->samplingFrequency)
-               return -E_MP4ASC;
        ms = 1000.0 * afhi->chunks_total * tmp / mp4ASC->samplingFrequency;
        ms2tv(ms, &total);
        tv_divide(afhi->chunks_total, &total, &afhi->chunk_tv);
@@ -242,6 +240,7 @@ static int aac_get_file_info(char *map, size_t numbytes, __a_unused int fd,
        afhi->chunk_table[0] = ret;
        for (i = 1; i<= afhi->chunks_total; i++)
                afhi->chunk_table[i] += ret;
+       set_max_chunk_size(afhi);
        afhi->channels = channels;
        afhi->frequency = rate;
        ret = (afhi->chunk_table[afhi->chunks_total] - afhi->chunk_table[0]) * 8; /* bits */