mood.c: Trivial cosmetics for int_sqrt().
[paraslash.git] / ogg_afh_common.c
index adab7f481fbb0e7873c1d1e1ac4968834bd81fe3..734fd58680b1f944f6adf51c76aebb19d1b5b5c7 100644 (file)
@@ -127,19 +127,18 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
 {
        ogg_sync_state oss;
        ogg_page op;
-       long len = numbytes;
        char *buf;
        int ret, i, j, frames_per_chunk, ct_size;
        long long unsigned num_frames = 0;
 
        ogg_sync_init(&oss);
        ret = -E_OGG_SYNC;
-       buf = ogg_sync_buffer(&oss, len);
+       buf = ogg_sync_buffer(&oss, numbytes);
        if (!buf)
                goto out;
-       memcpy(buf, map, len);
+       memcpy(buf, map, numbytes);
        ret = -E_OGG_SYNC;
-       if (ogg_sync_wrote(&oss, len) < 0)
+       if (ogg_sync_wrote(&oss, numbytes) < 0)
                goto out;
        ret = process_ogg_packets(&oss, afhi, ci);
        if (ret < 0)
@@ -182,6 +181,7 @@ int ogg_get_file_info(char *map, size_t numbytes, struct afh_info *afhi,
                }
        }
        afhi->chunks_total = j;
+       set_max_chunk_size(afhi);
        set_chunk_tv(frames_per_chunk, afhi->frequency, &afhi->chunk_tv);
        ret = 0;
 out: